mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:31:41 +03:00
c-ares: when resolving failed, persist error
Repeated calls to `Curl_async_is_resolved()` after a failure returned OK and not the error that was the result of the resolve fail. Reported-by: Joshua Rogers Closes #18999
This commit is contained in:
parent
03448f477a
commit
05fbe85e62
1 changed files with 8 additions and 3 deletions
|
|
@ -302,11 +302,13 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data,
|
|||
|
||||
if(data->state.async.done) {
|
||||
*dns = data->state.async.dns;
|
||||
return CURLE_OK;
|
||||
return ares->result;
|
||||
}
|
||||
|
||||
if(Curl_ares_perform(ares->channel, 0) < 0)
|
||||
return CURLE_UNRECOVERABLE_POLL;
|
||||
if(Curl_ares_perform(ares->channel, 0) < 0) {
|
||||
result = CURLE_UNRECOVERABLE_POLL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifndef HAVE_CARES_GETADDRINFO
|
||||
/* Now that we have checked for any last minute results above, see if there
|
||||
|
|
@ -371,6 +373,9 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data,
|
|||
result, *dns ? "" : "not ");
|
||||
async_ares_cleanup(data);
|
||||
}
|
||||
|
||||
out:
|
||||
ares->result = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue