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>
@@ -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);