From: Felix Fietkau Date: Tue, 25 Mar 2014 09:11:36 +0000 (+0100) Subject: fix connect error handling X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=7e7fe908839199cb28613d1f57eaeecf7d735bd3;p=project%2Fuclient.git fix connect error handling Signed-off-by: Felix Fietkau --- 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)