mirror of
https://github.com/moparisthebest/curl
synced 2024-11-10 11:35:07 -05:00
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.
This commit is contained in:
parent
030a2b8cb8
commit
b2a55c8106
@ -560,12 +560,19 @@ static CURLcode trynextip(struct connectdata *conn,
|
|||||||
ai = conn->tempaddr[0]->ai_next;
|
ai = conn->tempaddr[0]->ai_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(ai && ai->ai_family != family)
|
while(ai) {
|
||||||
ai = ai->ai_next;
|
while(ai && ai->ai_family != family)
|
||||||
|
ai = ai->ai_next;
|
||||||
|
|
||||||
if(ai) {
|
if(ai) {
|
||||||
rc = singleipconnect(conn, ai, &conn->tempsock[tempindex]);
|
rc = singleipconnect(conn, ai, &conn->tempsock[tempindex]);
|
||||||
conn->tempaddr[tempindex] = ai;
|
conn->tempaddr[tempindex] = ai;
|
||||||
|
if(rc == CURLE_COULDNT_CONNECT) {
|
||||||
|
ai = ai->ai_next;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user