From: Loïc Yhuel Date: Mon, 25 Sep 2023 19:12:42 +0000 (+0200) Subject: multi: fix small timeouts X-Git-Tag: curl-8_4_0~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=579f09343dd7f7531ef6ebc57e17fd9312eeeee4;p=thirdparty%2Fcurl.git 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 --- 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);