diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-23 01:23:00 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-23 01:23:00 +0100 |
commit | 4924411cff2e74d835b819151513367d08c9e524 (patch) | |
tree | 54f6f71817b9a7bf81900b96a5a3b7d78997402d /uclient-http.c | |
parent | b9808a8c3a8922ed8df4e6fe45848ac2e52f13be (diff) | |
download | uclient-4924411cff2e74d835b819151513367d08c9e524.tar.gz |
http: add proper error handling to uclient_http_redirect()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uclient-http.c')
-rw-r--r-- | uclient-http.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/uclient-http.c b/uclient-http.c index 195fa1c..6fc30da 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -1063,7 +1063,7 @@ uclient_http_read(struct uclient *cl, char *buf, unsigned int len) return len; } -bool uclient_http_redirect(struct uclient *cl) +int uclient_http_redirect(struct uclient *cl) { struct uclient_http *uh = container_of(cl, struct uclient_http, uc); struct blobmsg_policy location = { @@ -1095,7 +1095,9 @@ bool uclient_http_redirect(struct uclient *cl) free(cl->url); cl->url = url; - uclient_http_connect(cl); + if (uclient_http_connect(cl)) + return -1; + uclient_http_request_done(cl); return true; |