aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-03-11 16:28:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-03-11 16:28:23 +0000
commit652683fc04c8b45f3c34592a50be758b28bc0a1d (patch)
tree4eb004248955a18cc5738f087ee015985fc111b4
parent83a463891d843e1a21410665d080c5877282bc74 (diff)
Martin C. Martin's fix to produce an error message in case of failure
in the Curl_is_connected() function.
-rw-r--r--lib/connect.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 98bdaca31..ab38f60dd 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -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