cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] connect.c: return changed to CURLE_COULDNT_CONNECT when opensocket fails

From: Lijo Antony <lijotantony_at_gmail.com>
Date: Tue, 3 Apr 2012 02:45:25 +0400

Curl_socket returns CURLE_COULDNT_CONNECT when the opensocket callback
returns CURL_SOCKET_BAD. Previous return value CURLE_FAILED_INIT
conveys incorrect information to the user.

---
 lib/connect.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/connect.c b/lib/connect.c
index 38f68b4..2d59229 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -1228,7 +1228,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)) {
-- 
1.7.5.4
--------------040805020207010702030307
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
--------------040805020207010702030307--
Received on 2001-09-17