From 3b3e368dead01979e985cb167873fe9868b15d19 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 27 May 2019 02:31:57 +0000 Subject: [PATCH] uclient-http: set data_eof when content-length is 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise uclient-fetch can report "Connection reset prematurely" Fixes FS#2222 Signed-off-by: Yousong Zhou Acked-by: Petr Å tetiar --- uclient-http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uclient-http.c b/uclient-http.c index 3168f4c..c1f7228 100644 --- a/uclient-http.c +++ b/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); -- 2.30.2