mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
connect: wait for IPv4 connection attempts
... even if the last IPv6 connection attempt has failed. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1187531#c4
This commit is contained in:
parent
92835ca5d8
commit
e08a12dab1
@ -81,6 +81,7 @@ This release includes the following bugfixes:
|
|||||||
o cmake: Fix generation of tool_hugehelp.c on windows
|
o cmake: Fix generation of tool_hugehelp.c on windows
|
||||||
o cmake: fix winsock2 detection on windows
|
o cmake: fix winsock2 detection on windows
|
||||||
o gnutls: fix build with HTTP2
|
o gnutls: fix build with HTTP2
|
||||||
|
o connect: fix a spurious connect failure on dual-stacked hosts [16]
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
@ -117,3 +118,4 @@ References to bug reports and discussions on issues:
|
|||||||
[13] = http://curl.haxx.se/mail/lib-2015-02/0034.html
|
[13] = http://curl.haxx.se/mail/lib-2015-02/0034.html
|
||||||
[14] = http://curl.haxx.se/mail/lib-2015-01/0002.html
|
[14] = http://curl.haxx.se/mail/lib-2015-01/0002.html
|
||||||
[15] = https://github.com/bagder/curl/pull/139
|
[15] = https://github.com/bagder/curl/pull/139
|
||||||
|
[16] = https://bugzilla.redhat.com/1187531
|
||||||
|
@ -753,6 +753,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(i=0; i<2; i++) {
|
for(i=0; i<2; i++) {
|
||||||
|
const int other = i ^ 1;
|
||||||
if(conn->tempsock[i] == CURL_SOCKET_BAD)
|
if(conn->tempsock[i] == CURL_SOCKET_BAD)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -782,7 +783,6 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
else if(rc == CURL_CSELECT_OUT) {
|
else if(rc == CURL_CSELECT_OUT) {
|
||||||
if(verifyconnect(conn->tempsock[i], &error)) {
|
if(verifyconnect(conn->tempsock[i], &error)) {
|
||||||
/* we are connected with TCP, awesome! */
|
/* we are connected with TCP, awesome! */
|
||||||
int other = i ^ 1;
|
|
||||||
|
|
||||||
/* use this socket from now on */
|
/* use this socket from now on */
|
||||||
conn->sock[sockindex] = conn->tempsock[i];
|
conn->sock[sockindex] = conn->tempsock[i];
|
||||||
@ -824,6 +824,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
data->state.os_errno = error;
|
data->state.os_errno = error;
|
||||||
SET_SOCKERRNO(error);
|
SET_SOCKERRNO(error);
|
||||||
if(conn->tempaddr[i]) {
|
if(conn->tempaddr[i]) {
|
||||||
|
CURLcode status;
|
||||||
char ipaddress[MAX_IPADR_LEN];
|
char ipaddress[MAX_IPADR_LEN];
|
||||||
Curl_printable_address(conn->tempaddr[i], ipaddress, MAX_IPADR_LEN);
|
Curl_printable_address(conn->tempaddr[i], ipaddress, MAX_IPADR_LEN);
|
||||||
infof(data, "connect to %s port %ld failed: %s\n",
|
infof(data, "connect to %s port %ld failed: %s\n",
|
||||||
@ -832,7 +833,11 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
conn->timeoutms_per_addr = conn->tempaddr[i]->ai_next == NULL ?
|
conn->timeoutms_per_addr = conn->tempaddr[i]->ai_next == NULL ?
|
||||||
allow : allow / 2;
|
allow : allow / 2;
|
||||||
|
|
||||||
result = trynextip(conn, sockindex, i);
|
status = trynextip(conn, sockindex, i);
|
||||||
|
if(status != CURLE_COULDNT_CONNECT
|
||||||
|
|| conn->tempsock[other] == CURL_SOCKET_BAD)
|
||||||
|
/* the last attempt failed and no other sockets remain open */
|
||||||
|
result = status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user