From 7e7fe908839199cb28613d1f57eaeecf7d735bd3 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 25 Mar 2014 10:11:36 +0100 Subject: [PATCH] fix connect error handling Signed-off-by: Felix Fietkau --- uclient-http.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/uclient-http.c b/uclient-http.c index 045a772..bff6d38 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -668,6 +668,7 @@ static int uclient_setup_https(struct uclient_http *uh) static int uclient_http_connect(struct uclient *cl) { struct uclient_http *uh = container_of(cl, struct uclient_http, uc); + int ret; uclient_http_init_request(uh); @@ -677,9 +678,14 @@ static int uclient_http_connect(struct uclient *cl) uh->ssl = cl->url->prefix == PREFIX_HTTPS; if (uh->ssl) - return uclient_setup_https(uh); + ret = uclient_setup_https(uh); else - return uclient_setup_http(uh); + ret = uclient_setup_http(uh); + + if (ret) + uh->state = HTTP_STATE_ERROR; + + return ret; } static struct uclient *uclient_http_alloc(void) -- 2.25.1