aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/multi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 44771a309..06ffbd7b1 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1994,9 +1994,11 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
extracts a matching node if there is one */
now = Curl_tvnow();
- now.tv_usec += 1000; /* to compensate for the truncating of 999us to 0ms,
- we always add time here to make the comparison
- below better */
+ now.tv_usec += 40000; /* compensate for bad precision timers */
+ if(now.tv_usec > 1000000) {
+ now.tv_sec++;
+ now.tv_usec -= 1000000;
+ }
multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
if(t) {