add clear
This commit is contained in:
@@ -363,9 +363,11 @@ class HttpClient
|
|||||||
[$this->host, $this->port] = explode(':', $this->host);
|
[$this->host, $this->port] = explode(':', $this->host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->use_swoole) {
|
||||||
if (!$this->checkIsIp($this->host) && Coroutine::getuid() > 0) {
|
if (!$this->checkIsIp($this->host) && Coroutine::getuid() > 0) {
|
||||||
$this->host = System::gethostbyname($this->host);
|
$this->host = System::gethostbyname($this->host);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->checkIsIp($this->host) && !$this->isDomainName($this->host)) {
|
if (!$this->checkIsIp($this->host) && !$this->isDomainName($this->host)) {
|
||||||
throw new Exception('Client Host error.');
|
throw new Exception('Client Host error.');
|
||||||
@@ -398,7 +400,7 @@ class HttpClient
|
|||||||
return $this->curl($url, $data);
|
return $this->curl($url, $data);
|
||||||
}
|
}
|
||||||
$url = $this->matchHost(ltrim($url, '/'));
|
$url = $this->matchHost(ltrim($url, '/'));
|
||||||
if (!empty($this->port) && $this->port != 443) {
|
if (!empty($this->port)) {
|
||||||
$this->host .= ':' . $this->port;
|
$this->host .= ':' . $this->port;
|
||||||
}
|
}
|
||||||
if ($this->isSSL) {
|
if ($this->isSSL) {
|
||||||
@@ -623,7 +625,6 @@ class HttpClient
|
|||||||
private function curl($url, $data = [])
|
private function curl($url, $data = [])
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
var_dump($url);
|
|
||||||
$output = $this->curlParse($url, $data);
|
$output = $this->curlParse($url, $data);
|
||||||
if ($output === FALSE) {
|
if ($output === FALSE) {
|
||||||
return new Result(['code' => 500, 'message' => $output]);
|
return new Result(['code' => 500, 'message' => $output]);
|
||||||
|
|||||||
Reference in New Issue
Block a user