Failed connect returns CURLE_OPERATION_TIMEOUT instead of CURLE_COULDNT_CONNECT on Windows Server 2016
I did this
(Feel free to edit the title)
After updating from libcurl 8.19.0 to 8.22.0 we experienced the following problem in one of our system tests.
What the test does: We switch of one of our components during the system test (after having already executed some requests) to check whether or retry-handling works correctly.
Prior to the update we got CURLE_COULDNT_CONNECT when trying to execute a request after shutting down the component on localhost (it's a POST request executed via curl_easy_perform()), after the update we get a CURLE_OPERATION_TIMEOUT.
Also the timeout that actually is used is the operation timeout and not the connection timeout.
We re-tried with libcurl 8.21.0 - this worked the same way like 8.19.0, so the change that introduced this new behaviour seems to be introduced in 8.22.0. The unrealeased master version, that I tried (aff6f9332aa67... https://github.com/curl/curl/commit/aff6f9332aa673a8cec31cde0be9992e84f0162d) also behaved the same way as 8.22.0.
When running on Windows Professional 11 this seems not to be the case. There the connection timeout and correct error code is used with libcurl 8.22.0. So this seems to be something specific to some and not all windows environments.
I expected the following
CURLE_COULDNT_CONNECT when a connection cannot be made after the connection timout expired (or sooner) - as with libcurl 8.19.0 - and not CURLE_OPERATION_TIMEOUT after the operation timeout expired.
curl/libcurl version
libcurl 8.22.0 (built with vcpkg)
operating system
Microsoft Windows Server 2016 Standard
Source: curl/curl