aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-07-17 19:22:28 +0000
committerYang Tse <yangsita@gmail.com>2006-07-17 19:22:28 +0000
commitef82da93fb8e8409cb369598a3e22be6c50fb16b (patch)
tree398fc5e4aad87eebd52cfaef7305bc6219420863
parent06d05b18b28d67b8745b63266f253276a24b901e (diff)
"*connected" must be set to FALSE if trynextip() fails.
-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;