summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-10-04 13:29:04 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-10-04 13:29:04 +0200
commit62a7e7de4699e87ee60eb7f92c5f2a50116502b8 (patch)
treeb18889534411dc21c1e8ef4f8608576a875633f1
parentb902b0632d82945636d53bec325645540c4926a6 (diff)
downloadcurl-62a7e7de4699e87ee60eb7f92c5f2a50116502b8.tar.gz
connect: return CURLE_OPERATION_TIMEDOUT for errno == ETIMEDOUT
Previosly all connect() failures would return CURLE_COULDNT_CONNECT, no matter what errno said. This makes for example --retry work on these transfer failures. Fixes #4461
-rw-r--r--lib/connect.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 77196250d..bb2275e4d 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -976,6 +976,14 @@ CURLcode Curl_is_connected(struct connectdata *conn,
failf(data, "Failed to connect to %s port %ld: %s",
hostname, conn->port,
Curl_strerror(error, buffer, sizeof(buffer)));
+
+#ifdef WSAETIMEDOUT
+ if(WSAETIMEDOUT == data->state.os_errno)
+ result = CURLE_OPERATION_TIMEDOUT;
+#elif defined(ETIMEDOUT)
+ if(ETIMEDOUT == data->state.os_errno)
+ result = CURLE_OPERATION_TIMEDOUT;
+#endif
}
return result;