From 80ead6d2bb126fb2ec06f5d5fa9b96815f0acea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 2 Dec 2020 18:55:12 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index 8f61e30..4559a5e 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -363,8 +363,10 @@ class HttpClient [$this->host, $this->port] = explode(':', $this->host); } - if (!$this->checkIsIp($this->host) && Coroutine::getuid() > 0) { - $this->host = System::gethostbyname($this->host); + if ($this->use_swoole) { + if (!$this->checkIsIp($this->host) && Coroutine::getuid() > 0) { + $this->host = System::gethostbyname($this->host); + } } if (!$this->checkIsIp($this->host) && !$this->isDomainName($this->host)) { @@ -398,7 +400,7 @@ class HttpClient return $this->curl($url, $data); } $url = $this->matchHost(ltrim($url, '/')); - if (!empty($this->port) && $this->port != 443) { + if (!empty($this->port)) { $this->host .= ':' . $this->port; } if ($this->isSSL) { @@ -623,7 +625,6 @@ class HttpClient private function curl($url, $data = []) { try { - var_dump($url); $output = $this->curlParse($url, $data); if ($output === FALSE) { return new Result(['code' => 500, 'message' => $output]);