From aa96e80d837188bc3bbd99328fa3c6c28066edc9 Mon Sep 17 00:00:00 2001 From: yf <29323003@qq.com> Date: Tue, 25 Dec 2018 15:46:47 +0800 Subject: [PATCH] fix bug --- src/HttpClient.php | 3 +++ src/Multi.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/HttpClient.php b/src/HttpClient.php index aefc877..5cf1d58 100644 --- a/src/HttpClient.php +++ b/src/HttpClient.php @@ -202,6 +202,9 @@ private function createClient():Client private function getUri(?string $path, ?string $query): string { + if($path == null){ + $path = '/'; + } return !empty($query) ? $path . '?' . $query : $path; } } \ No newline at end of file diff --git a/src/Multi.php b/src/Multi.php index fac929d..3418585 100644 --- a/src/Multi.php +++ b/src/Multi.php @@ -33,11 +33,15 @@ function exec(float $timeout = 1.0):array }); } $ret = []; + $all = count($this->list); $start = microtime(true); while (1){ if(round(microtime(true) - $start,3) > $timeout ){ break; } + if(count($ret) == $all){ + break; + } $temp = $channel->pop(0.01); if(is_array($temp)){ $ret = $ret+$temp;