diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-07-31 15:30:31 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-08-01 07:43:24 +0200 |
commit | b1616dad8f088d873d88f88b4d884335a4ca285f (patch) | |
tree | 31637b618958b051693d23591042468243fe0b35 /lib/progress.c | |
parent | 7c14dde9240a6a113358fe551f378328a41477e2 (diff) | |
download | curl-b1616dad8f088d873d88f88b4d884335a4ca285f.tar.gz |
timediff: make it 64 bit (if possible) even with 32 bit time_t
... to make it hold microseconds too.
Fixes #4165
Closes #4168
Diffstat (limited to 'lib/progress.c')
-rw-r--r-- | lib/progress.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/progress.c b/lib/progress.c index 8f81f28b7..2aa929599 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -26,6 +26,7 @@ #include "sendf.h" #include "multiif.h" #include "progress.h" +#include "timeval.h" #include "curl_printf.h" /* check rate limits within this many recent milliseconds, at minimum. */ @@ -168,7 +169,7 @@ void Curl_pgrsResetTransferSizes(struct Curl_easy *data) void Curl_pgrsTime(struct Curl_easy *data, timerid timer) { struct curltime now = Curl_now(); - time_t *delta = NULL; + timediff_t *delta = NULL; switch(timer) { default: @@ -270,8 +271,8 @@ timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize, struct curltime now) { curl_off_t size = cursize - startsize; - time_t minimum; - time_t actual; + timediff_t minimum; + timediff_t actual; if(!limit || !size) return 0; @@ -284,10 +285,10 @@ timediff_t Curl_pgrsLimitWaitTime(curl_off_t cursize, minimum = (time_t) (CURL_OFF_T_C(1000) * size / limit); else { minimum = (time_t) (size / limit); - if(minimum < TIME_T_MAX/1000) + if(minimum < TIMEDIFF_T_MAX/1000) minimum *= 1000; else - minimum = TIME_T_MAX; + minimum = TIMEDIFF_T_MAX; } /* |