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
This commit is contained in:
Loïc Yhuel 2023-09-25 21:12:42 +02:00 committed by Daniel Stenberg
parent 06133d3e9b
commit 579f09343d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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);