summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/asyn-ares.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-14 15:03:53 (GMT)
committerBrad King <brad.king@kitware.com>2017-06-14 15:10:22 (GMT)
commita3ef36f153f51c33ea2154cff17bbf9abb7ee073 (patch)
tree94283929f1d08444c255a490d10810d7c5df0e04 /Utilities/cmcurl/lib/asyn-ares.c
parent91101f108d68e8fe98c378f06e1ed12a513151fe (diff)
parent06d6d6c4aee149cd6560b919ef6935ef0867d921 (diff)
downloadCMake-a3ef36f153f51c33ea2154cff17bbf9abb7ee073.zip
CMake-a3ef36f153f51c33ea2154cff17bbf9abb7ee073.tar.gz
CMake-a3ef36f153f51c33ea2154cff17bbf9abb7ee073.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2017-06-14 (54b636f1) Resolve a logical conflict in `Utilities/cmcurl/CMakeLists.txt` by disabling CA bundle/path detection for build within CMake. CMake already handles locating a CA bundle/path at runtime.
Diffstat (limited to 'Utilities/cmcurl/lib/asyn-ares.c')
-rw-r--r--Utilities/cmcurl/lib/asyn-ares.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Utilities/cmcurl/lib/asyn-ares.c b/Utilities/cmcurl/lib/asyn-ares.c
index 281fb03..11a914f 100644
--- a/Utilities/cmcurl/lib/asyn-ares.c
+++ b/Utilities/cmcurl/lib/asyn-ares.c
@@ -232,7 +232,7 @@ int Curl_resolver_getsock(struct connectdata *conn,
milli = (timeout->tv_sec * 1000) + (timeout->tv_usec/1000);
if(milli == 0)
milli += 10;
- Curl_expire_latest(conn->data, milli);
+ Curl_expire(conn->data, milli, EXPIRE_ASYNC_NAME);
return max;
}
@@ -373,7 +373,6 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
/* Wait for the name resolve query to complete. */
while(!result) {
struct timeval *tvp, tv, store;
- long timediff;
int itimeout;
int timeout_ms;
@@ -402,8 +401,13 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
result = CURLE_ABORTED_BY_CALLBACK;
else {
struct timeval now2 = Curl_tvnow();
- timediff = Curl_tvdiff(now2, now); /* spent time */
- timeout -= timediff?timediff:1; /* always deduct at least 1 */
+ time_t timediff = Curl_tvdiff(now2, now); /* spent time */
+ if(timediff <= 0)
+ timeout -= 1; /* always deduct at least 1 */
+ else if(timediff > timeout)
+ timeout = -1;
+ else
+ timeout -= (long)timediff;
now = now2; /* for next loop */
}
if(timeout < 0)