[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 39/205: ares: better error return on timeouts
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 39/205: ares: better error return on timeouts |
Date: |
Thu, 20 Apr 2017 16:19:39 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.0
in repository gnurl.
commit bfaab3180ca53d683d514b33a7967e7c7835eab7
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Mar 6 22:45:10 2017 +0100
ares: better error return on timeouts
Assisted-by: Ray Satiro
Bug: https://curl.haxx.se/mail/lib-2017-03/0009.html
---
lib/asyn-ares.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c
index ae73d0502..4baaef06a 100644
--- a/lib/asyn-ares.c
+++ b/lib/asyn-ares.c
@@ -368,7 +368,7 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */
/* Wait for the name resolve query to complete. */
- for(;;) {
+ while(!result) {
struct timeval *tvp, tv, store;
long timediff;
int itimeout;
@@ -390,28 +390,25 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata
*conn,
timeout_ms = 1000;
waitperform(conn, timeout_ms);
- Curl_resolver_is_resolved(conn, &temp_entry);
+ result = Curl_resolver_is_resolved(conn, &temp_entry);
- if(conn->async.done)
+ if(result || conn->async.done)
break;
- if(Curl_pgrsUpdate(conn)) {
+ if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
- timeout = -1; /* trigger the cancel below */
- }
else {
struct timeval now2 = Curl_tvnow();
timediff = Curl_tvdiff(now2, now); /* spent time */
timeout -= timediff?timediff:1; /* always deduct at least 1 */
now = now2; /* for next loop */
}
-
- if(timeout < 0) {
- /* our timeout, so we cancel the ares operation */
- ares_cancel((ares_channel)data->state.resolver);
- break;
- }
+ if(timeout < 0)
+ result = CURLE_OPERATION_TIMEDOUT;
}
+ if(result)
+ /* failure, so we cancel the ares operation */
+ ares_cancel((ares_channel)data->state.resolver);
/* Operation complete, if the lookup was successful we now have the entry
in the cache. */
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 62/205: cmdline-opts: fixed a few typos, (continued)
- [GNUnet-SVN] [gnurl] 62/205: cmdline-opts: fixed a few typos, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 61/205: README.md: add coverity and travis badges, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 58/205: tests: disabled 1903 now, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 83/205: CURLINFO_LOCAL_PORT.3: added example, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 79/205: build: removed redundant DEPENDENCIES from makefiles, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 82/205: SSLCERTS.md: mention HTTPS proxies and their separate options, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 53/205: bump: next release will be known as 7.54.0, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 71/205: tool_writeout: fixed a buffer read overrun on --write-out, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 87/205: tests: strip more options from non-HTTP --libcurl tests, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 84/205: CURLINFO_LOCAL_PORT.3: fix typo, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 39/205: ares: better error return on timeouts,
gnunet <=
- [GNUnet-SVN] [gnurl] 109/205: openssl: fix comparison between signed and unsigned integer expressions, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 80/205: KNOWN_BUGS: remove libidn related issue, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 92/205: multi: fix streamclose() crash in debug mode, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 66/205: proxy: skip SSL initialization for closed connections, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 75/205: make: regenerate docs/curl.1 by runinng make in docs, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 100/205: test2033: flaky, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 89/205: tests: fixed the documented test server port numbers, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 101/205: make: introduce 'test-nonflaky' target, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 72/205: test1287: added verbose logs keyword, gnunet, 2017/04/20
- [GNUnet-SVN] [gnurl] 76/205: RELEASE-NOTES: synced with c25e0761d0fc49c4, gnunet, 2017/04/20