"*connected" must be set to FALSE if trynextip() fails.
authorYang Tse <yangsita@gmail.com>
Mon, 17 Jul 2006 19:22:28 +0000 (19:22 +0000)
committerYang Tse <yangsita@gmail.com>
Mon, 17 Jul 2006 19:22:28 +0000 (19:22 +0000)
lib/connect.c

index b12cf8b84b544135cb172a690e3d029d5f9c62c0..a24a1217851616d049c61e18f1462d4e3f97696b 100644 (file)
@@ -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;