summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/asyn-ares.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-24 19:17:42 (GMT)
committerBrad King <brad.king@kitware.com>2018-01-24 19:18:16 (GMT)
commitcd8e31a1bf7429514078c2923a1a9580113f9d4f (patch)
tree6a0b8a01e3e0e52bb4b3abb66ce9e992614af6a7 /Utilities/cmcurl/lib/asyn-ares.c
parente9c8ea75575afdb4e87b262641ee4071ef42b4c6 (diff)
parentaf9e654045f11028e50dac4781e297834129a749 (diff)
downloadCMake-cd8e31a1bf7429514078c2923a1a9580113f9d4f.zip
CMake-cd8e31a1bf7429514078c2923a1a9580113f9d4f.tar.gz
CMake-cd8e31a1bf7429514078c2923a1a9580113f9d4f.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2018-01-23 (d6c21c8e)
Diffstat (limited to 'Utilities/cmcurl/lib/asyn-ares.c')
-rw-r--r--Utilities/cmcurl/lib/asyn-ares.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/Utilities/cmcurl/lib/asyn-ares.c b/Utilities/cmcurl/lib/asyn-ares.c
index 87e70b4..aa581a4 100644
--- a/Utilities/cmcurl/lib/asyn-ares.c
+++ b/Utilities/cmcurl/lib/asyn-ares.c
@@ -22,9 +22,15 @@
#include "curl_setup.h"
-#ifdef HAVE_LIMITS_H
+/***********************************************************************
+ * Only for ares-enabled builds
+ * And only for functions that fulfill the asynch resolver backend API
+ * as defined in asyn.h, nothing else belongs in this file!
+ **********************************************************************/
+
+#ifdef CURLRES_ARES
+
#include <limits.h>
-#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
@@ -48,14 +54,6 @@
#define in_addr_t unsigned long
#endif
-/***********************************************************************
- * Only for ares-enabled builds
- * And only for functions that fulfill the asynch resolver backend API
- * as defined in asyn.h, nothing else belongs in this file!
- **********************************************************************/
-
-#ifdef CURLRES_ARES
-
#include "urldata.h"
#include "sendf.h"
#include "hostip.h"
@@ -354,8 +352,8 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
- long timeout;
- struct curltime now = Curl_tvnow();
+ timediff_t timeout;
+ struct curltime now = Curl_now();
struct Curl_dns_entry *temp_entry;
if(entry)
@@ -400,8 +398,8 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
if(Curl_pgrsUpdate(conn))
result = CURLE_ABORTED_BY_CALLBACK;
else {
- struct curltime now2 = Curl_tvnow();
- time_t timediff = Curl_tvdiff(now2, now); /* spent time */
+ struct curltime now2 = Curl_now();
+ timediff_t timediff = Curl_timediff(now2, now); /* spent time */
if(timediff <= 0)
timeout -= 1; /* always deduct at least 1 */
else if(timediff > timeout)