Merge pull request #3505 from annando/1705-probe-timeout

Better handling of timeout issues while probing
This commit is contained in:
rabuzarus 2017-05-31 13:07:23 +02:00 committed by GitHub
commit 12cb5a6848

View file

@ -123,13 +123,13 @@ class Probe {
} }
if (!is_object($xrd)) { if (!is_object($xrd)) {
logger("No xrd object found for ".$host, LOGGER_DEBUG); logger("No xrd object found for ".$host, LOGGER_DEBUG);
return false; return array();
} }
$links = xml::element_to_array($xrd); $links = xml::element_to_array($xrd);
if (!isset($links["xrd"]["link"])) { if (!isset($links["xrd"]["link"])) {
logger("No xrd data found for ".$host, LOGGER_DEBUG); logger("No xrd data found for ".$host, LOGGER_DEBUG);
return false; return array();
} }
$xrd_data = array(); $xrd_data = array();
@ -222,6 +222,10 @@ class Probe {
$lrdd = self::xrd($uri); $lrdd = self::xrd($uri);
$webfinger = null; $webfinger = null;
if (is_bool($lrdd)) {
return array();
}
if (!$lrdd) { if (!$lrdd) {
$parts = @parse_url($uri); $parts = @parse_url($uri);
if (!$parts) { if (!$parts) {
@ -424,6 +428,10 @@ class Probe {
} }
$lrdd = self::xrd($host); $lrdd = self::xrd($host);
if (is_bool($lrdd)) {
return array();
}
$path_parts = explode("/", trim($parts["path"], "/")); $path_parts = explode("/", trim($parts["path"], "/"));
while (!$lrdd AND (sizeof($path_parts) > 1)) { while (!$lrdd AND (sizeof($path_parts) > 1)) {
@ -462,6 +470,10 @@ class Probe {
} }
$lrdd = self::xrd($host); $lrdd = self::xrd($host);
if (is_bool($lrdd)) {
return array();
}
if (!$lrdd) { if (!$lrdd) {
logger('No XRD data was found for '.$uri, LOGGER_DEBUG); logger('No XRD data was found for '.$uri, LOGGER_DEBUG);
return self::mail($uri, $uid); return self::mail($uri, $uid);