From 4e1eee1500202a6a21fbedbd6e84d0e6c9af4b50 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 Nov 2019 15:11:23 +0100 Subject: multi_poll: avoid busy-loop when called without easy handles attached Fixes #4594 Closes #4595 Reported-by: 3dyd on github --- lib/multi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/multi.c b/lib/multi.c index 7e8e38dc9..a0de107f0 100755 --- a/lib/multi.c +++ b/lib/multi.c @@ -1157,6 +1157,10 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, if(!curl_multi_timeout(multi, &sleep_ms) && sleep_ms) { if(sleep_ms > timeout_ms) sleep_ms = timeout_ms; + /* when there are no easy handles in the multi, this holds a -1 + timeout */ + else if((sleep_ms < 0) && extrawait) + sleep_ms = timeout_ms; Curl_wait_ms((int)sleep_ms); } } -- cgit v1.2.3