aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-08-04 12:38:01 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-08-04 12:38:01 +0000
commit55e61c092ed05b5fbe92e7f212d98bf331ba22c0 (patch)
treecc7a7e2718482ab775e522a1a87f061677c14357
parentde6ab3de22affd84eddd5ace857efb34a57aafc0 (diff)
Fixed multiple IP connects with the multi interface. This fix is influenced
by Gisle Vanem's patch, only modified by me.
-rw-r--r--lib/connect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/connect.c b/lib/connect.c
index de8d29726..9d29a0a27 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -432,7 +432,6 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
more address exists */
static bool trynextip(struct connectdata *conn,
int sockindex,
- long timeout,
bool *connected)
{
curl_socket_t sockfd;
@@ -441,13 +440,15 @@ static bool trynextip(struct connectdata *conn,
if(sockindex != FIRSTSOCKET)
return TRUE; /* no next */
+ /* try the next address */
ai = conn->ip_addr->ai_next;
while (ai) {
- sockfd = singleipconnect(conn, ai, timeout, connected);
+ sockfd = singleipconnect(conn, ai, 0L, connected);
if(sockfd != CURL_SOCKET_BAD) {
/* store the new socket descriptor */
conn->sock[sockindex] = sockfd;
+ conn->ip_addr = ai;
return FALSE;
}
ai = ai->ai_next;
@@ -514,14 +515,14 @@ CURLcode Curl_is_connected(struct connectdata *conn,
}
/* nope, not connected for real */
infof(data, "Connection failed\n");
- if(trynextip(conn, sockindex, allow-has_passed, connected)) {
+ if(trynextip(conn, sockindex, connected)) {
code = CURLE_COULDNT_CONNECT;
}
}
else if(WAITCONN_TIMEOUT != rc) {
/* nope, not connected */
infof(data, "Connection failed\n");
- if(trynextip(conn, sockindex, allow-has_passed, connected)) {
+ if(trynextip(conn, sockindex, connected)) {
int error = Curl_ourerrno();
failf(data, "Failed connect to %s:%d; %s",
conn->host.name, conn->port, Curl_strerror(conn,error));