From: Daniel Stenberg Date: Tue, 8 Feb 2005 07:36:57 +0000 (+0000) Subject: Curl_wait_for_resolv() no longer disconnects on failure, but leaves that X-Git-Tag: before_ftp_statemachine~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e36fb1ecda1782204dbd352f7e2e836c019dd3e3;p=thirdparty%2Fcurl.git Curl_wait_for_resolv() no longer disconnects on failure, but leaves that operation to the caller. Disconnecting has the disadvantage that the conn pointer gets completely invalidated and this is not handled on lots of places in the code. --- diff --git a/lib/hostares.c b/lib/hostares.c index 48d62115e6..a54e25eda5 100644 --- a/lib/hostares.c +++ b/lib/hostares.c @@ -249,7 +249,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn, /* close the connection, since we can't return failure here without cleaning up this connection properly */ - Curl_disconnect(conn); + conn->bits.close = TRUE; } return rc; diff --git a/lib/transfer.c b/lib/transfer.c index bf67842a17..ea7c5dbe34 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -2038,6 +2038,8 @@ Curl_connect_host(struct SessionHandle *data, if(CURLE_OK == res) /* Resolved, continue with the connection */ res = Curl_async_resolved(*conn); + else + (void)Curl_disconnect(*conn); } if(res) break;