diff --git a/src/Symfony/Component/HttpClient/CurlHttpClient.php b/src/Symfony/Component/HttpClient/CurlHttpClient.php index 702491f8fa..204bcd8b93 100644 --- a/src/Symfony/Component/HttpClient/CurlHttpClient.php +++ b/src/Symfony/Component/HttpClient/CurlHttpClient.php @@ -290,6 +290,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of CurlResponse objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses))); } + $active = 0; while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active)); return new ResponseStream(CurlResponse::stream($responses, $timeout)); @@ -302,6 +303,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null); } + $active = 0; while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active)); foreach ($this->multi->openHandles as $ch) { diff --git a/src/Symfony/Component/HttpClient/Response/CurlResponse.php b/src/Symfony/Component/HttpClient/Response/CurlResponse.php index 30dd31f0ae..20fab3a6eb 100644 --- a/src/Symfony/Component/HttpClient/Response/CurlResponse.php +++ b/src/Symfony/Component/HttpClient/Response/CurlResponse.php @@ -255,6 +255,7 @@ final class CurlResponse implements ResponseInterface try { self::$performing = true; + $active = 0; while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($multi->handle, $active)); while ($info = curl_multi_info_read($multi->handle)) {