summaryrefslogtreecommitdiff
path: root/lib/asyn-thread.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-29 00:08:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-30 23:10:57 +0200
commit842f73de58f38bd6e285e08bbd1adb6c17cb62cd (patch)
treec28cb0b85895d71f19373ab732736a5fa671ebff /lib/asyn-thread.c
parentfc55c723c4ecebabf12c32caddd0f9bc9d169ed4 (diff)
downloadcurl-842f73de58f38bd6e285e08bbd1adb6c17cb62cd.tar.gz
timeouts: change millisecond timeouts to timediff_t from time_t
For millisecond timers we like timediff_t better. Also, time_t can be unsigned so returning a negative value doesn't work then. Closes #5479
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r--lib/asyn-thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 36735fc60..3ab253d8c 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -179,7 +179,7 @@ struct thread_sync_data {
struct thread_data {
curl_thread_t thread_hnd;
unsigned int poll_interval;
- time_t interval_end;
+ timediff_t interval_end;
struct thread_sync_data tsd;
};
@@ -622,8 +622,8 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
else {
/* poll for name lookup done with exponential backoff up to 250ms */
/* should be fine even if this converts to 32 bit */
- time_t elapsed = (time_t)Curl_timediff(Curl_now(),
- data->progress.t_startsingle);
+ timediff_t elapsed = Curl_timediff(Curl_now(),
+ data->progress.t_startsingle);
if(elapsed < 0)
elapsed = 0;
@@ -648,7 +648,7 @@ int Curl_resolver_getsock(struct connectdata *conn,
curl_socket_t *socks)
{
int ret_val = 0;
- time_t milli;
+ timediff_t milli;
timediff_t ms;
struct Curl_easy *data = conn->data;
struct resdata *reslv = (struct resdata *)data->state.resolver;
@@ -672,7 +672,7 @@ int Curl_resolver_getsock(struct connectdata *conn,
if(ms < 3)
milli = 0;
else if(ms <= 50)
- milli = (time_t)ms/3;
+ milli = ms/3;
else if(ms <= 250)
milli = 50;
else