summaryrefslogtreecommitdiff
path: root/uclient-fetch.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-fetch.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-fetch.c')
-rw-r--r--uclient-fetch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/uclient-fetch.c b/uclient-fetch.c
index 8dcb97b..6a27cde 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -151,6 +151,11 @@ static void init_request(struct uclient *cl)
static void eof_cb(struct uclient *cl)
{
+ if (!cl->data_eof) {
+ if (!quiet)
+ fprintf(stderr, "Connection reset prematurely\n");
+ error_ret = 4;
+ }
request_done(cl);
}