summaryrefslogtreecommitdiffstats
path: root/Source/CTest/Curl/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/Curl/connect.c')
-rw-r--r--Source/CTest/Curl/connect.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/CTest/Curl/connect.c b/Source/CTest/Curl/connect.c
index eb6f4f3..5aa9f8b 100644
--- a/Source/CTest/Curl/connect.c
+++ b/Source/CTest/Curl/connect.c
@@ -176,10 +176,9 @@ int waitconnect(int sockfd, /* socket */
/* timeout, no connect today */
return 1;
- if(FD_ISSET(sockfd, &errfd)) {
+ if(FD_ISSET(sockfd, &errfd))
/* error condition caught */
return 2;
- }
/* we have a connect! */
return 0;
@@ -380,6 +379,11 @@ CURLcode Curl_is_connected(struct connectdata *conn,
return CURLE_OPERATION_TIMEOUTED;
}
}
+ if(conn->bits.tcpconnect) {
+ /* we are connected already! */
+ *connected = TRUE;
+ return CURLE_OK;
+ }
/* check for connect without timeout as we want to return immediately */
rc = waitconnect(sockfd, 0);
@@ -646,6 +650,15 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
}
}
+ /* The '1 == rc' comes from the waitconnect(), and not from connect().
+ We can be sure of this since connect() cannot return 1. */
+ if((1 == rc) && (data->state.used_interface == Curl_if_multi)) {
+ /* Timeout when running the multi interface, we return here with a
+ CURLE_OK return code. */
+ rc = 0;
+ break;
+ }
+
if(0 == rc) {
int err = socketerror(sockfd);
if ((0 == err) || (EISCONN == err)) {
@@ -658,12 +671,6 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
}
if(0 != rc) {
- if(data->state.used_interface == Curl_if_multi) {
- /* When running the multi interface, we bail out here */
- rc = 0;
- break;
- }
-
/* get a new timeout for next attempt */
after = Curl_tvnow();
timeout_ms -= Curl_tvdiff(after, before);