From 5061a17342d5bf2a46eb38e5e5136eb1a5a75191 Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 28 Nov 2025 11:30:07 +0800 Subject: [PATCH] ea --- CurlClient.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CurlClient.php b/CurlClient.php index 2ae63e1..85c5eb8 100644 --- a/CurlClient.php +++ b/CurlClient.php @@ -155,11 +155,12 @@ class CurlClient extends ClientAbstracts { $output = curl_exec($this->client); if ($output !== FALSE) { - $this->explode($this->client, $output); + $this->explode($output); } else { $this->setStatusCode(curl_errno($this->client)); $this->setBody(curl_error($this->client)); } + $this->close(); } @@ -195,13 +196,13 @@ class CurlClient extends ClientAbstracts * @return void * @throws */ - private function explode($ch, string $output): void + private function explode(string $output): void { // 获取 HTTP 状态码 - $statusCode = +curl_getinfo($ch, CURLINFO_HTTP_CODE); + $statusCode = +curl_getinfo($this->client, CURLINFO_HTTP_CODE); // 获取 header 的大小(不包括最后的 \r\n\r\n 分隔符) - $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + $headerSize = curl_getinfo($this->client, CURLINFO_HEADER_SIZE); $header = substr($output, 0, $headerSize); if (in_array($statusCode, [502, 404])) { $this->retry();