mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 09:21:50 -05:00
singleipconnect: return OK even when Curl_socket() fails
Commit 9109cdec11ee5a brought this regression (shipped since 7.24.0). The singleipconnect() function must not return an error if Curl_socket() returns an error. It should then simply return OK and pass a SOCKET_BAD back simply because that is how the user of this function expects it to work and something else is not fine. Reported by: Blaise Potard Bug: http://curl.haxx.se/bug/view.cgi?id=3516508
This commit is contained in:
parent
94111bbbd4
commit
5cd524df18
@ -881,7 +881,10 @@ singleipconnect(struct connectdata *conn,
|
|||||||
|
|
||||||
res = Curl_socket(conn, ai, &addr, &sockfd);
|
res = Curl_socket(conn, ai, &addr, &sockfd);
|
||||||
if(res)
|
if(res)
|
||||||
return res;
|
/* Failed to create the socket, but still return OK since we signal the
|
||||||
|
lack of socket as well. This allows the parent function to keep looping
|
||||||
|
over alternative addresses/socket families etc. */
|
||||||
|
return CURLE_OK;
|
||||||
|
|
||||||
/* store remote address and port used in this connection attempt */
|
/* store remote address and port used in this connection attempt */
|
||||||
if(!getaddressinfo((struct sockaddr*)&addr.sa_addr,
|
if(!getaddressinfo((struct sockaddr*)&addr.sa_addr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user