diff options
author | dartraiden <wowemuh@gmail.com> | 2022-07-02 23:09:35 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2022-07-02 23:09:35 +0300 |
commit | 5882ac58f5d5cbcfa9f9d4015285d4f5d2b7c755 (patch) | |
tree | ab1c3cd0b9893ecfef62702fbb9811f610b8b224 /libs/libcurl/src/asyn-ares.c | |
parent | 59efa751fe2e8189c625b67d9c98b7155e59022e (diff) |
libcurl: update to 7.84.0
Diffstat (limited to 'libs/libcurl/src/asyn-ares.c')
-rw-r--r-- | libs/libcurl/src/asyn-ares.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/libcurl/src/asyn-ares.c b/libs/libcurl/src/asyn-ares.c index c885adef54..8b620a1d64 100644 --- a/libs/libcurl/src/asyn-ares.c +++ b/libs/libcurl/src/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" @@ -306,7 +308,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) @@ -338,8 +340,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; @@ -376,7 +381,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 @@ -475,7 +481,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) |