-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Mismatching/wrong error message for connect failure #9549
Comments
Which libcurl version on which operating system? |
Had just realized i forgot the version and was adding it, the application is linked to a static curl 7.71.1, the operating system is windows. |
It looks like it uses the wrong errno so it gets the completely wrong text in there. The code has changed a bit since 7.71.0 but the current code has the same Lines 1073 to 1081 in 8e5b1b6
|
The "Failed to connect to" message after a connection failure would include the strerror message based on the presumed previous socket error, but in times it seems that error number is not set when reaching this code and therefore it would include the wrong error message. The strerror message is now removed from here and the curl_easy_strerror error is used instead. Reported-by: Edoardo Lolletti Fixes #9549
I use libcurl in my application, and some times I kept getting users having issues with teh application downloading contents, in my application I log all curl errors via the recommended approach, by both passing
CURLOPT_ERRORBUFFER
and callingcurl_easy_strerror
on the return code.Those users were getting logged as the error
pretty weird error to get, especially since winsock is initialized in the application and the other networking parts of the application worked fine.

By providing a build of my program where I also set
CURLOPT_VERBOSE
in the operation, now in stderror the actual error is printedbut the error description returned in the error buffer still contains the wrong message.
It also turned out that those users can't access that domain even via browser, so it might be a domain blocked by their ISP (hence the timeout).
The text was updated successfully, but these errors were encountered: