-
-
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
“Could not resolve host” error with curl_multi on cURL version 7.64 #3629
Comments
It's a little unclear what this actually says the problem is. Reading the PHP code, it seems to suggest that even if the transfers run OK,
This code seems to ignore this detail that is specifically noted in the man page:
But okay, I created a version of this code written in plain C that to the best of my understanding uses the same logic as the PHP code. Running this with the latest libcurl I cannot reproduce this problem. What makes you even suspect this is related to #3446 ? |
wow, thanks very much for your immediate help :)
Oh wow I think you are correct. It looks like that the return code is correctly Is there anything that changed though in 7.63 and 7.64 which could make the buffer be filled with a message like
Sorry for confusing here, I was just searching through the git issues and found a very suspect issue regarding multi connections in curl. Realizing now that the response actually worked, I agree that it has nothing to do with it. |
I've managed to reproduce. The work-around is still to not check the error buffer if there's no error. Will file a PR with a fix as soon as I have one. |
When a transfer is done, the resolver thread will be brought down. That could accidentally generate an error message in the error buffer even though this is not an error situationand the transfer would still return OK. An application that still reads the error buffer could find a "Could not resolve host: [host name]" message there and get confused. Reported-by: Michael Schmid Fixes #3629
For the record: I just needed to make sure I ran my sample code using a libcurl built to use the threaded resolver and it occurred at once. |
CURLOPT_ERRORBUFFER doc says "Do not rely on the contents of the buffer unless an error code was returned." [1] Prior to this change the error buffer was returned even if no error had occurred, and that buffer may contain incorrect information in such a case. [2] [1]: https://curl.haxx.se/libcurl/c/CURLOPT_ERRORBUFFER.html [2]: curl/curl#3629 Closes #xxxx
CURLOPT_ERRORBUFFER doc says "Do not rely on the contents of the buffer unless an error code was returned." [1] Prior to this change the error buffer was returned even if no error had occurred, and that buffer may contain incorrect information in such a case. [2] [1]: https://curl.haxx.se/libcurl/c/CURLOPT_ERRORBUFFER.html [2]: curl/curl#3629
Basically copying this over from https://stackoverflow.com/questions/54771917/could-not-resolve-host-error-with-curl-multi-on-curl-version-7-64
I'm not the author of the StackOverflow question, but I have the exact same issue.
I did this
php script:
output:
Reproduce:
This will upgrade curl to 7.64.0 which has the issue:
I expected the following
This will keep curl on 7.63.0 which does not have the issue
curl/libcurl version
operating system
Could this maybe have to do with #3446 ?
The text was updated successfully, but these errors were encountered: