From ba030f00221cd53cfbce79a4faa8a977c5fa2661 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Tue, 6 Aug 2019 15:20:03 +0200 Subject: [PATCH] [HttpClient] Declare `$active` first to prevent weird issue --- src/Symfony/Component/HttpClient/CurlHttpClient.php | 2 ++ src/Symfony/Component/HttpClient/Response/CurlResponse.php | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Symfony/Component/HttpClient/CurlHttpClient.php b/src/Symfony/Component/HttpClient/CurlHttpClient.php index 702491f8fa3e7..204bcd8b93ded 100644 --- a/src/Symfony/Component/HttpClient/CurlHttpClient.php +++ b/src/Symfony/Component/HttpClient/CurlHttpClient.php @@ -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)); @@ -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) { diff --git a/src/Symfony/Component/HttpClient/Response/CurlResponse.php b/src/Symfony/Component/HttpClient/Response/CurlResponse.php index 30dd31f0aedd9..20fab3a6eb6b4 100644 --- a/src/Symfony/Component/HttpClient/Response/CurlResponse.php +++ b/src/Symfony/Component/HttpClient/Response/CurlResponse.php @@ -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)) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy