diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-10-04 13:29:04 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-10-09 14:16:28 +0200 |
commit | 490effc193f548d02f7cc9b05eb19350e28cc5e7 (patch) | |
tree | 05531f8a34af22bcb15be814d421aa79576b386c | |
parent | 5584aa96f81b5808e47f62cfd1d0f726f49ec2fa (diff) |
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.
Reported-by: Nathaniel J. Smith
Fixes #4461
Clsoes #4462
-rw-r--r-- | lib/connect.c | 8 |
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; |