From: Daniel Stenberg Date: Thu, 14 Nov 2019 14:11:23 +0000 (+0100) Subject: multi_poll: avoid busy-loop when called without easy handles attached X-Git-Tag: curl-7_68_0~168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e1eee1500202a6a21fbedbd6e84d0e6c9af4b50;p=thirdparty%2Fcurl.git multi_poll: avoid busy-loop when called without easy handles attached Fixes #4594 Closes #4595 Reported-by: 3dyd on github --- diff --git a/lib/multi.c b/lib/multi.c index 7e8e38dc9f..a0de107f0e 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); } }