From 2e8ab65270e7d1ebe1ef0dfe13836c29d72c7010 Mon Sep 17 00:00:00 2001 From: Pierrick Charron Date: Sat, 22 Sep 2012 10:15:40 -0400 Subject: Avoid calling select if maxfd returned by curl_multi_fdset is -1 As per libcurl documentation : When libcurl returns -1 in max_fd, it is because libcurl currently does something that isn't possible for your application to monitor with a socket and unfortunately you can then not know exactly when the current action is completed using select(). --- ext/curl/multi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 034aa65c28..53e97b80f8 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -191,6 +191,9 @@ PHP_FUNCTION(curl_multi_select) FD_ZERO(&exceptfds); curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd); + if (maxfd == -1) { + RETURN_LONG(-1); + } RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to)); } /* }}} */ -- cgit v1.2.1