summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2019-05-27 02:31:57 +0000
committerYousong Zhou <yszhou4tech@gmail.com>2019-05-30 10:32:35 +0000
commit3b3e368dead01979e985cb167873fe9868b15d19 (patch)
treef937806509a289b9eb39182306380b421e716a82
parent3ba74ebc9363993ea2a83fd73b4c1b1a96e73940 (diff)
downloaduclient-3b3e368dead01979e985cb167873fe9868b15d19.tar.gz
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>
-rw-r--r--uclient-http.c3
1 files changed, 2 insertions, 1 deletions
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);