aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/connect.c7
1 files changed, 4 insertions, 3 deletions
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;