summaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-11-14 15:11:23 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-11-14 23:22:22 +0100
commit4e1eee1500202a6a21fbedbd6e84d0e6c9af4b50 (patch)
tree6ec817bd52541d37347a126761f9bd85038a9dce /lib/multi.c
parent7a46aeb0be3fa00826b0c47a8bc06eddff448659 (diff)
downloadcurl-4e1eee1500202a6a21fbedbd6e84d0e6c9af4b50.tar.gz
multi_poll: avoid busy-loop when called without easy handles attached
Fixes #4594 Closes #4595 Reported-by: 3dyd on github
Diffstat (limited to 'lib/multi.c')
-rwxr-xr-xlib/multi.c4
1 files changed, 4 insertions, 0 deletions
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);
}
}