aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-10-09 22:19:49 +0200
committerDaniel Stenberg <daniel@haxx.se>2012-10-09 22:19:49 +0200
commit8373ca3641ce793a868377600fb5fd7b8e8bf95a (patch)
treef830bd7bd23affe94bd9ed4d6f79974706729981 /lib
parent3644a3502751529db0b4f0e8bdc220526596d208 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/multi.c8
1 files changed, 6 insertions, 2 deletions
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;