summaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 38f68b42..42b626f1 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -881,7 +881,10 @@ singleipconnect(struct connectdata *conn,
res = Curl_socket(conn, ai, &addr, &sockfd);
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 */
if(!getaddressinfo((struct sockaddr*)&addr.sa_addr,
@@ -1228,7 +1231,7 @@ CURLcode Curl_socket(struct connectdata *conn,
if(*sockfd == CURL_SOCKET_BAD)
/* no socket, no connection */
- return CURLE_FAILED_INIT;
+ return CURLE_COULDNT_CONNECT;
#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
if(conn->scope && (addr->family == AF_INET6)) {