]> granicus.if.org Git - curl/commitdiff
Martin C. Martin's fix to produce an error message in case of failure
authorDaniel Stenberg <daniel@haxx.se>
Tue, 11 Mar 2003 16:28:23 +0000 (16:28 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 11 Mar 2003 16:28:23 +0000 (16:28 +0000)
in the Curl_is_connected() function.

lib/connect.c

index 98bdaca319d0e0035e9c981068862a3a620e2c29..ab38f60dd1cd431fafe74fdf390eaea1ca651998 100644 (file)
@@ -410,12 +410,15 @@ CURLcode Curl_is_connected(struct connectdata *conn,
       return CURLE_OK;
     }
     /* nope, not connected for real */
-    if(err)
-      return CURLE_COULDNT_CONNECT;
+    failf(data, "Connection failed, socket error: %d", err);
+    return CURLE_COULDNT_CONNECT;
   }
-  else if(1 != rc)
+  else if(1 != rc) {
+    int error = ourerrno();
+    failf(data, "Failed connect to %s:%d, errno: %d",
+          conn->hostname, conn->port, error);
     return CURLE_COULDNT_CONNECT;
-
+  }
   /*
    * If the connection phase is "done" here, we should attempt to connect
    * to the "next address" in the Curl_hostaddr structure that we resolved