summaryrefslogtreecommitdiffstats
path: root/modules-available/dnbd3/inc/dnbd3rpc.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/dnbd3/inc/dnbd3rpc.inc.php')
-rw-r--r--modules-available/dnbd3/inc/dnbd3rpc.inc.php17
1 files changed, 4 insertions, 13 deletions
diff --git a/modules-available/dnbd3/inc/dnbd3rpc.inc.php b/modules-available/dnbd3/inc/dnbd3rpc.inc.php
index a26ae4fd..f6bbf0ca 100644
--- a/modules-available/dnbd3/inc/dnbd3rpc.inc.php
+++ b/modules-available/dnbd3/inc/dnbd3rpc.inc.php
@@ -18,17 +18,9 @@ class Dnbd3Rpc {
// Special case - local server
if ($server === '<self>') {
$server = '127.0.0.1:5003';
- } elseif (($out = Dnbd3Util::matchAddress($server))) {
- if (isset($out['v4'])) {
- $server = $out['v4'];
- } else {
- $server = '[' . $out['v6'] . ']';
- }
- if (isset($out['port'])) {
- $server .= $out['port'];
- } else {
- $server .= ':5003';
- }
+ } elseif (($out = Dnbd3Util::matchAddress($server)) !== false) {
+ $server = $out['v4'] ?? '[' . $out['v6'] . ']';
+ $server .= $out['port'] ?? ':5003';
}
return $server;
}
@@ -72,7 +64,6 @@ class Dnbd3Rpc {
/**
* Get statistics for multiple servers at once.
* @param string[] $servers
- * @return array
*/
public static function getStatsMulti(array $servers, array $queryOptions = [], int $timeout = 2): array
{
@@ -91,7 +82,7 @@ class Dnbd3Rpc {
$url = 'http://' . self::translateServer($server) . '/query?q=version' . $extra;
$res = curl_init($url);
if ($res === false) {
- error_log("curl_init($url) failed with $res");
+ error_log("curl_init($url) failed");
continue;
}
curl_setopt_array($res, [