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
This commit is contained in:
Daniel Stenberg 2017-10-26 15:24:50 +02:00
parent 9dfc541dd7
commit 0d85eed3df
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 19 additions and 18 deletions

View file

@ -57,7 +57,7 @@ int Curl_blockread_all(struct connectdata *conn, /* connection data */
ssize_t nread;
ssize_t allread = 0;
int result;
time_t timeleft;
timediff_t timeleft;
*n = 0;
for(;;) {
timeleft = Curl_timeleft(conn->data, NULL, TRUE);
@ -382,7 +382,7 @@ CURLcode Curl_SOCKS5(const char *proxy_user,
CURLcode code;
curl_socket_t sock = conn->sock[sockindex];
struct Curl_easy *data = conn->data;
time_t timeout;
timediff_t timeout;
bool socks5_resolve_local =
(conn->socks_proxy.proxytype == CURLPROXY_SOCKS5) ? TRUE : FALSE;
const size_t hostname_len = strlen(hostname);