From 8373ca3641ce793a868377600fb5fd7b8e8bf95a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 9 Oct 2012 22:19:49 +0200 Subject: 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 --- lib/multi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/multi.c b/lib/multi.c index 6506b5ee4..938846769 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -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; -- cgit v1.2.3