[HttpClient] Declare $active
first to prevent weird issue
This commit is contained in:
parent
36466a3ab5
commit
ba030f0022
@ -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)));
|
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));
|
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
||||||
|
|
||||||
return new ResponseStream(CurlResponse::stream($responses, $timeout));
|
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);
|
curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$active = 0;
|
||||||
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
||||||
|
|
||||||
foreach ($this->multi->openHandles as $ch) {
|
foreach ($this->multi->openHandles as $ch) {
|
||||||
|
@ -255,6 +255,7 @@ final class CurlResponse implements ResponseInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
self::$performing = true;
|
self::$performing = true;
|
||||||
|
$active = 0;
|
||||||
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($multi->handle, $active));
|
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($multi->handle, $active));
|
||||||
|
|
||||||
while ($info = curl_multi_info_read($multi->handle)) {
|
while ($info = curl_multi_info_read($multi->handle)) {
|
||||||
|
Reference in New Issue
Block a user