From 18c6f9594e93c015a0874ef8c66f9f5962d4fb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 11 Jan 2022 15:31:37 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=94=B9=E5=90=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdf58326 --- AsyncClient.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AsyncClient.php b/AsyncClient.php index 1c42361..f1d4532 100644 --- a/AsyncClient.php +++ b/AsyncClient.php @@ -109,7 +109,7 @@ class AsyncClient extends ClientAbstracts $array = $this->_parseHeaders($path); if ($this->client->send(implode("\r\n", $array) . "\r\n\r\n" . $content)) { - $receive = $this->client->recv(); + $receive = $this->waite($this->client, ''); Kiri::getDi()->get(Logger::class)->debug($receive); @@ -143,17 +143,17 @@ class AsyncClient extends ClientAbstracts /** + * @param $client * @param $string * @return mixed */ - private function waite($string): mixed + private function waite($client, $string): mixed { - $tmp = $this->client->recv(); - if (empty($tmp)) { - return $string; + $tmp = $client->recv(); + if (!empty($tmp)) { + return $this->waite($client, $string . $tmp); } - $string .= $tmp; - return $this->waite($string); + return $string; }