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;