summaryrefslogtreecommitdiff
path: root/uclient-http.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-08-21 21:10:30 +0200
committerFelix Fietkau <nbd@openwrt.org>2014-08-21 21:10:31 +0200
commit80e135d9726eb897cd7d9e45a17bbd59e3a8b236 (patch)
tree3ee39cd84fb08c931b06bf70e019549d17fed3e4 /uclient-http.c
parent5152b7147e7a2fbb4543160e69ea75dbb3b5821a (diff)
downloaduclient-80e135d9726eb897cd7d9e45a17bbd59e3a8b236.tar.gz
http: ignore empty lines before HTTP response
Fixes HTTP keepalive issues with some servers Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uclient-http.c')
-rw-r--r--uclient-http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/uclient-http.c b/uclient-http.c
index 47c890f..4633956 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -552,6 +552,9 @@ static void uclient_parse_http_line(struct uclient_http *uh, char *data)
if (uh->state == HTTP_STATE_REQUEST_DONE) {
char *code;
+ if (!strlen(data))
+ return;
+
/* HTTP/1.1 */
strsep(&data, " ");