diff --git a/Internal/CurlClientState.php b/Internal/CurlClientState.php index 8af4c75..60aab71 100644 --- a/Internal/CurlClientState.php +++ b/Internal/CurlClientState.php @@ -83,7 +83,6 @@ public function reset(): void foreach ($this->pushedResponses as $url => $response) { $this->logger?->debug(\sprintf('Unused pushed response: "%s"', $url)); curl_multi_remove_handle($this->handle, $response->handle); - curl_close($response->handle); } $this->pushedResponses = []; diff --git a/Response/AmpResponseV4.php b/Response/AmpResponseV4.php index e1fc119..3f652a4 100644 --- a/Response/AmpResponseV4.php +++ b/Response/AmpResponseV4.php @@ -101,7 +101,8 @@ public function __construct( $throttleWatcher = null; - $this->id = $id = self::$nextId++; + $this->id = $id = self::$nextId; + self::$nextId = str_increment(self::$nextId); Loop::defer(static function () use ($request, $multi, $id, &$info, &$headers, $canceller, &$options, $onProgress, &$handle, $logger, &$pause) { return new Coroutine(self::generateResponse($request, $multi, $id, $info, $headers, $canceller, $options, $onProgress, $handle, $logger, $pause)); }); diff --git a/Response/AmpResponseV5.php b/Response/AmpResponseV5.php index 7fc1036..2a673be 100644 --- a/Response/AmpResponseV5.php +++ b/Response/AmpResponseV5.php @@ -96,7 +96,8 @@ public function __construct( }; $pause = 0.0; - $this->id = $id = self::$nextId++; + $this->id = $id = self::$nextId; + self::$nextId = str_increment(self::$nextId); $info['pause_handler'] = static function (float $duration) use (&$pause) { $pause = $duration; diff --git a/composer.json b/composer.json index 39e43f5..869bab8 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", "symfony/http-client-contracts": "~3.4.4|^3.5.2", + "symfony/polyfill-php83": "^1.29", "symfony/service-contracts": "^2.5|^3" }, "require-dev": {