curl_multi_wait: no wait if no descriptors to wait for

This is a minor change in behavior after having been pointed out by Mark
Tully and discussed on the list. Initially this case would internally
call poll() with no sockets and a timeout which would equal a sleep for
that specified time.

Bug: http://curl.haxx.se/mail/lib-2012-10/0076.html
Reported by: Mark Tully
This commit is contained in:
Daniel Stenberg
2012-10-09 22:19:49 +02:00
parent 3644a35027
commit 8373ca3641
2 changed files with 10 additions and 3 deletions

View File

@@ -1024,8 +1024,12 @@ CURLMcode curl_multi_wait(CURLM *multi_handle,
++nfds;
}
/* wait... */
i = Curl_poll(ufds, nfds, timeout_ms);
if(nfds)
/* wait... */
i = Curl_poll(ufds, nfds, timeout_ms);
else
i = 0;
free(ufds);
if(ret)
*ret = i;