diff --git a/src/HttpClient/CurlClient.php b/src/HttpClient/CurlClient.php index 83813e9..34291c8 100644 --- a/src/HttpClient/CurlClient.php +++ b/src/HttpClient/CurlClient.php @@ -111,7 +111,6 @@ public function send(string $method, string $url, array $body, array $headers = $error = curl_error($ch); if ($error) { - $this->closeHandle($ch); if ($attempt < $retries) { $this->sleepBackoff($backoffMs, $attempt); $attempt++; @@ -122,7 +121,6 @@ public function send(string $method, string $url, array $body, array $headers = $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); - $this->closeHandle($ch); if ($code >= 500 && $attempt < $retries) { $this->sleepBackoff($backoffMs, $attempt); $attempt++; @@ -232,14 +230,6 @@ private function parseHeaders(string $rawHeaders): array return $headers; } - /** - * Close the cURL handle. - */ - private function closeHandle(\CurlHandle $handle): void - { - curl_close($handle); - } - /** * @param int $backoffMs * @param int $attempt