From: Yang Tse Date: Mon, 17 Jul 2006 19:22:28 +0000 (+0000) Subject: "*connected" must be set to FALSE if trynextip() fails. X-Git-Tag: curl-7_15_5~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef82da93fb8e8409cb369598a3e22be6c50fb16b;p=curl "*connected" must be set to FALSE if trynextip() fails. --- diff --git a/lib/connect.c b/lib/connect.c index b12cf8b84..a24a12178 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -504,12 +504,13 @@ static bool trynextip(struct connectdata *conn, curl_socket_t sockfd; Curl_addrinfo *ai; - if(sockindex != FIRSTSOCKET) - return TRUE; /* no next */ - /* first close the failed socket */ sclose(conn->sock[sockindex]); conn->sock[sockindex] = CURL_SOCKET_BAD; + *connected = FALSE; + + if(sockindex != FIRSTSOCKET) + return TRUE; /* no next */ /* try the next address */ ai = conn->ip_addr->ai_next;