diff options
| author | robot-contrib <[email protected]> | 2022-07-12 12:03:53 +0300 |
|---|---|---|
| committer | robot-contrib <[email protected]> | 2022-07-12 12:03:53 +0300 |
| commit | eeebfbedb3ea4cab5c0aac178b683b7dd26b0bf6 (patch) | |
| tree | 4783d362be8e22467d0f5eb581ce6f65e33acb04 /contrib/libs/curl/lib/asyn-ares.c | |
| parent | 4213b519b93b5e3d657bc362837adfea82579dcc (diff) | |
Update contrib/libs/curl to 7.84.0
Diffstat (limited to 'contrib/libs/curl/lib/asyn-ares.c')
| -rw-r--r-- | contrib/libs/curl/lib/asyn-ares.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/libs/curl/lib/asyn-ares.c b/contrib/libs/curl/lib/asyn-ares.c index b4e612d5e22..1d478c7ecb7 100644 --- a/contrib/libs/curl/lib/asyn-ares.c +++ b/contrib/libs/curl/lib/asyn-ares.c @@ -18,6 +18,8 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * + * SPDX-License-Identifier: curl + * ***************************************************************************/ #include "curl_setup.h" @@ -308,7 +310,7 @@ int Curl_resolver_getsock(struct Curl_easy *data, * 2) wait for the timeout period to check for action on ares' sockets. * 3) tell ares to act on all the sockets marked as "with action" * - * return number of sockets it worked on + * return number of sockets it worked on, or -1 on error */ static int waitperform(struct Curl_easy *data, timediff_t timeout_ms) @@ -340,8 +342,11 @@ static int waitperform(struct Curl_easy *data, timediff_t timeout_ms) break; } - if(num) + if(num) { nfds = Curl_poll(pfd, num, timeout_ms); + if(nfds < 0) + return -1; + } else nfds = 0; @@ -378,7 +383,8 @@ CURLcode Curl_resolver_is_resolved(struct Curl_easy *data, DEBUGASSERT(dns); *dns = NULL; - waitperform(data, 0); + if(waitperform(data, 0) < 0) + return CURLE_UNRECOVERABLE_POLL; #ifndef HAVE_CARES_GETADDRINFO /* Now that we've checked for any last minute results above, see if there are @@ -477,7 +483,8 @@ CURLcode Curl_resolver_wait_resolv(struct Curl_easy *data, else timeout_ms = 1000; - waitperform(data, timeout_ms); + if(waitperform(data, timeout_ms) < 0) + return CURLE_UNRECOVERABLE_POLL; result = Curl_resolver_is_resolved(data, entry); if(result || data->state.async.done) |
