mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
this fix seems to make the connect fail properly even on IPv4-only Linux
machines!
This commit is contained in:
parent
52dbc96c32
commit
0e7203be89
@ -309,9 +309,8 @@ static CURLcode bindlocal(struct connectdata *conn,
|
|||||||
|
|
||||||
return CURLE_HTTP_PORT_FAILED;
|
return CURLE_HTTP_PORT_FAILED;
|
||||||
}
|
}
|
||||||
#else /* end of ipv4-specific section */
|
#endif /* end of ipv4-specific section */
|
||||||
|
|
||||||
/* we only use socketerror() on IPv6-enabled machines */
|
|
||||||
static
|
static
|
||||||
int socketerror(int sockfd)
|
int socketerror(int sockfd)
|
||||||
{
|
{
|
||||||
@ -324,7 +323,6 @@ int socketerror(int sockfd)
|
|||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TCP connect to the given host with timeout, proxy or remote doesn't matter.
|
* TCP connect to the given host with timeout, proxy or remote doesn't matter.
|
||||||
@ -525,6 +523,16 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(0 == rc) {
|
||||||
|
int err = socketerror(sockfd);
|
||||||
|
if ((0 == err) || (EISCONN == err)) {
|
||||||
|
/* we are connected, awesome! */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* nope, not connected for real */
|
||||||
|
rc = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if(0 != rc) {
|
if(0 != rc) {
|
||||||
/* get a new timeout for next attempt */
|
/* get a new timeout for next attempt */
|
||||||
after = Curl_tvnow();
|
after = Curl_tvnow();
|
||||||
|
Loading…
Reference in New Issue
Block a user