10000 [HttpClient] Declare `$active` first to prevent weird issue by Kocal · Pull Request #32989 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] Declare $active first to prevent weird issue #32989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpClient/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
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));
Expand All @@ -302,6 +303,7 @@ public function __destruct()
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) {
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpClient/Response/CurlResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ private static function perform(CurlClientState $multi, array &$responses = null

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)) {
Expand Down
0