Skip to content

Commit 18b257e

Browse files
author
Kyra Farrow
committed
[HttpClient] Declare $active first to prevent weird issue
1 parent 83d9a37 commit 18b257e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CurlHttpClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
290290
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)));
291291
}
292292

293+
$active = 0;
293294
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
294295

295296
return new ResponseStream(CurlResponse::stream($responses, $timeout));
@@ -302,6 +303,7 @@ public function __destruct()
302303
curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null);
303304
}
304305

306+
$active = 0;
305307
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
306308

307309
foreach ($this->multi->openHandles as $ch) {

Response/CurlResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ private static function perform(CurlClientState $multi, array &$responses = null
255255

256256
try {
257257
self::$performing = true;
258+
$active = 0;
258259
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($multi->handle, $active));
259260

260261
while ($info = curl_multi_info_read($multi->handle)) {

0 commit comments

Comments
 (0)