From 030f337e74027696ace8752b0c0cbe25f94336bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 10 Jan 2022 18:36:35 +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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AsyncClient.php b/AsyncClient.php index 051fa2b..45d6bc9 100644 --- a/AsyncClient.php +++ b/AsyncClient.php @@ -77,13 +77,13 @@ class AsyncClient extends ClientAbstracts private function generate_client($data, $host, $isHttps, $path): void { $this->client = new SwowClient(SWOOLE_TCP, FALSE); - if (!$this->client->connect($host, $this->getPort())) { - throw new Exception('链接失败'); - } if ($isHttps || $this->isSSL()) { $this->client->enableSSL(); } $this->client->set(array_merge($this->settings(), ['open_http_protocol' => true])); + if (!$this->client->connect($host, $this->getPort())) { + throw new Exception('链接失败'); + } if (!empty($this->getAgent())) { $this->withAddedHeader('User-Agent', $this->getAgent()); }