summaryrefslogtreecommitdiff
path: root/uclient-http.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-05-07 23:21:52 +0200
committerFelix Fietkau <nbd@openwrt.org>2014-05-07 23:21:52 +0200
commit9ceca0a12166cefdf07aedc3c187fdd2f72fdec8 (patch)
tree0832be27b9011695a6d610b610eb047b2e3596e3 /uclient-http.c
parent3a61c3f4a8820def50e7fbe68e31a07648102eca (diff)
downloaduclient-9ceca0a12166cefdf07aedc3c187fdd2f72fdec8.tar.gz
fetch: indicate an error if the connection was terminated prematurely
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uclient-http.c')
-rw-r--r--uclient-http.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/uclient-http.c b/uclient-http.c
index ee161e6..9652fb8 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -928,8 +928,10 @@ uclient_http_read(struct uclient *cl, char *buf, unsigned int len)
read_len += sep + 2 - data;
data = sep + 2;
- if (!uh->read_chunked)
+ if (!uh->read_chunked) {
uh->eof = true;
+ uh->uc.data_eof = true;
+ }
}
if (len > data_end - data)
@@ -945,8 +947,10 @@ uclient_http_read(struct uclient *cl, char *buf, unsigned int len)
len = uh->content_length;
uh->content_length -= len;
- if (!uh->content_length)
+ if (!uh->content_length) {
uh->eof = true;
+ uh->uc.data_eof = true;
+ }
}
if (len > 0) {