]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multi: fix small timeouts
authorLoïc Yhuel <loic.yhuel@softathome.com>
Mon, 25 Sep 2023 19:12:42 +0000 (21:12 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 25 Sep 2023 22:58:47 +0000 (00:58 +0200)
Since Curl_timediff rounds down to the millisecond, timeouts which
expire in less than 1ms are considered as outdated and removed from the
list. We can use Curl_timediff_us instead, big timeouts could saturate
but this is not an issue.

Closes #11937

lib/multi.c

index 15b998865e27f8f143a4946fa4633cc9f5b9eddd..a79f2ef1f884bb820999cc70887da0ed80cf9b1a 100644 (file)
@@ -3139,7 +3139,7 @@ static CURLMcode add_next_timeout(struct curltime now,
     struct Curl_llist_element *n = e->next;
     timediff_t diff;
     node = (struct time_node *)e->ptr;
-    diff = Curl_timediff(node->time, now);
+    diff = Curl_timediff_us(node->time, now);
     if(diff <= 0)
       /* remove outdated entry */
       Curl_llist_remove(list, e, NULL);