From 62a7e7de4699e87ee60eb7f92c5f2a50116502b8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 4 Oct 2019 13:29:04 +0200 Subject: 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 --- lib/connect.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- cgit v1.2.1