From 83a86a2a57b0d7497776b5bac172d74ffd3d3ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 21 May 2020 16:42:42 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index e5a828a..314bf33 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -3,6 +3,7 @@ namespace wchat\common; use Exception; +use Swoole\Coroutine; use Swoole\Coroutine\Http\Client as SClient; use Swoole\Coroutine\System; use Swoole\Coroutine\Client; @@ -340,7 +341,7 @@ class HttpClient [$this->host, $this->port] = explode(':', $this->host); } - if (!$this->checkIsIp($this->host)) { + if (!$this->checkIsIp($this->host) && Coroutine::getuid() > 0) { $this->host = System::gethostbyname($this->host); }