-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] libcurl 7.88.0 - Immediate connect fail for x.x.x.x: Socket is already connected #10626
Comments
You need to give us more details. How can we reproduce this? |
This issue happens only when we use CURLOPT_OPENSOCKETFUNCTION and CURLOPT_SOCKOPTFUNCTION socket options to use the application created sockets by curl library. In curl 7.87.0 version it was working fine but below commit (available in 7.88.0) broke this functionality. In 7.87.0, if callback method for CURLOPT_SOCKOPTFUNCTION returns CURL_SOCKOPT_ALREADY_CONNECTED then curl library used to return CURLE_OK. In 7.88.0, now even if callback returns CURL_SOCKOPT_ALREADY_CONNECTED, curl library still tries to connect to socket by invoking method [in file cf-socket.c/ function cf_tcp_connect() ] /* Connect TCP socket */ And then it fails with WSAEISCONN error i.e. ("Socket is already connected"). |
This will fix the issue mentioned at curl#10626 In 7.87.0, if callback method for CURLOPT_SOCKOPTFUNCTION returns CURL_SOCKOPT_ALREADY_CONNECTED then curl library used to return CURLE_OK. n 7.88.0, now even if callback returns CURL_SOCKOPT_ALREADY_CONNECTED, curl library still tries to connect to socket by invoking method do_connect(). This is regression caused by commit curl@71b7e01#diff-96ac2b9e301765fa5e816e0c41282610e9c0193a5852cc9bb0ed053b1fc4ef7f Fix: Check if we are already connected and return CURLE_OK.
In 7.87.0, if callback method for CURLOPT_SOCKOPTFUNCTION returns CURL_SOCKOPT_ALREADY_CONNECTED then curl library used to return CURLE_OK. n 7.88.0, now even if callback returns CURL_SOCKOPT_ALREADY_CONNECTED, curl library still tries to connect to socket by invoking method do_connect(). This is regression caused by commit curl@71b7e0161032927cdfb Fix: Check if we are already connected and return CURLE_OK. Fixes curl#10626 Closes curl#10648
I downloaded libcurl version 7.88.0 and used it in my application on Windows box. But I am seeing failure in my application and curl log shows below error.
curl_debug_logger(): == Info: Added my_host_name:1555:x.x.x.x to DNS cache
curl_debug_logger(): == Info: Hostname my_host_name was found in DNS cache
curl_debug_logger(): == Info: Trying x.x.x.x:1555...
curl_debug_logger(): == Info: Immediate connect fail for x.x.x.x: Socket is already connected
curl_debug_logger(): == Info: Failed to connect to my_host_name port 1555 after 0 ms: Couldn't connect to server
curl_debug_logger(): == Info: Closing connection 0
I tried with curl version 7.88.1 too, but same issue. Also issue is seen on Windows platform only, on RHEL it works fine.
If I use curl version 7.87.0 then it works properly.
curl/libcurl version
7.88.0
operating system
Windows
The text was updated successfully, but these errors were encountered: