From 579f09343dd7f7531ef6ebc57e17fd9312eeeee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Yhuel?= Date: Mon, 25 Sep 2023 21:12:42 +0200 Subject: [PATCH] multi: fix small timeouts 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/multi.c b/lib/multi.c index 15b998865e..a79f2ef1f8 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -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);