From 80e135d9726eb897cd7d9e45a17bbd59e3a8b236 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 21 Aug 2014 21:10:30 +0200 Subject: [PATCH] http: ignore empty lines before HTTP response Fixes HTTP keepalive issues with some servers Signed-off-by: Felix Fietkau --- uclient-http.c | 3 +++ 1 file changed, 3 insertions(+) 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, " "); -- 2.30.2