Browse Source

uclient-http: set data_eof when content-length is 0

Otherwise uclient-fetch can report "Connection reset prematurely"

Fixes FS#2222

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Acked-by: Petr Štetiar <ynezz@true.cz>
Yousong Zhou 5 years ago
parent
commit
3b3e368dea
1 changed files with 2 additions and 1 deletions
  1. 2 1
      uclient-http.c

+ 2 - 1
uclient-http.c

@@ -199,7 +199,8 @@ static void uclient_notify_eof(struct uclient_http *uh)
 			return;
 	}
 
-	if (uh->content_length < 0 && uh->read_chunked >= 0)
+	if ((uh->content_length < 0 && uh->read_chunked >= 0) ||
+			uh->content_length == 0)
 		uh->uc.data_eof = true;
 
 	uclient_backend_set_eof(&uh->uc);