From 0d85eed3dfbbce18303900385d17f84d939cef00 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 26 Oct 2017 15:24:50 +0200 Subject: Curl_timeleft: change return type to timediff_t returning 'time_t' is problematic when that type is unsigned and we return values less than zero to signal "already expired", used in several places in the code. Closes #2021 --- lib/connect.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/connect.h') diff --git a/lib/connect.h b/lib/connect.h index 3f05c3978..397448636 100644 --- a/lib/connect.h +++ b/lib/connect.h @@ -25,6 +25,7 @@ #include "nonblock.h" /* for curlx_nonblock(), formerly Curl_nonblock() */ #include "sockaddr.h" +#include "timeval.h" CURLcode Curl_is_connected(struct connectdata *conn, int sockindex, @@ -35,9 +36,9 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* generic function that returns how much time there's left to run, according to the timeouts set */ -time_t Curl_timeleft(struct Curl_easy *data, - struct curltime *nowp, - bool duringconnect); +timediff_t Curl_timeleft(struct Curl_easy *data, + struct curltime *nowp, + bool duringconnect); #define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */ #define HAPPY_EYEBALLS_TIMEOUT 200 /* milliseconds to wait between -- cgit v1.2.3