Skip to content
Snippets Groups Projects
Commit b2a55c81 authored by Björn Stenberg's avatar Björn Stenberg Committed by Daniel Stenberg
Browse files

connect: Try next ip directly after immediate connect fail

This fixes a rare Happy Eyeballs bug where if the first IP family runs
out of addresses before the second-family-timer fires, and the second
IP family's first connect fails immediately, no further IPs of the
second family are attempted.
parent 030a2b8c
No related branches found
No related tags found
No related merge requests found
......@@ -560,12 +560,19 @@ static CURLcode trynextip(struct connectdata *conn,
ai = conn->tempaddr[0]->ai_next;
}
while(ai && ai->ai_family != family)
ai = ai->ai_next;
if(ai) {
rc = singleipconnect(conn, ai, &conn->tempsock[tempindex]);
conn->tempaddr[tempindex] = ai;
while(ai) {
while(ai && ai->ai_family != family)
ai = ai->ai_next;
if(ai) {
rc = singleipconnect(conn, ai, &conn->tempsock[tempindex]);
conn->tempaddr[tempindex] = ai;
if(rc == CURLE_COULDNT_CONNECT) {
ai = ai->ai_next;
continue;
}
}
break;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment