diff options
author | Youfu Zhang <zhangyoufu@gmail.com> | 2021-03-11 20:58:33 +0800 |
---|---|---|
committer | Baptiste Jonglez <git@bitsofnetworks.org> | 2021-05-14 23:25:26 +0200 |
commit | 6a6011df3429ffa5958d12b1327eeda4fd9daa47 (patch) | |
tree | 2e5486a0eabcc835695c956a0b1bbe03b7c6d6d1 | |
parent | 19571e4f947c27d6bb406d5a88334cc7ad901b7e (diff) | |
download | uclient-6a6011df3429ffa5958d12b1327eeda4fd9daa47.tar.gz |
uclient-http: set eof mark when content-length is 0
or uclient-fetch will stall until timeout for 2XX (except 204) response
with content-length of 0
Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
-rw-r--r-- | uclient-http.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/uclient-http.c b/uclient-http.c index 349e69c..c2bba6b 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -655,7 +655,8 @@ static void uclient_http_headers_complete(struct uclient_http *uh) if (uh->eof || seq != uh->uc.seq) return; - if (uh->req_type == REQ_HEAD || uh->uc.status_code == 204) { + if (uh->req_type == REQ_HEAD || uh->uc.status_code == 204 || + uh->content_length == 0) { uh->eof = true; uclient_notify_eof(uh); } |