diff options
author | Mario <mario@mariovavti.com> | 2020-10-19 07:25:30 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-10-19 07:25:30 +0000 |
commit | 5e0f5460f2ee92aecc53fd900e55d54fa5326fc5 (patch) | |
tree | 85bb65f1bf043bd7665df3925d9114796d6fbb08 /include/hubloc.php | |
parent | ff8c9cfd1485c2bc96e6fe59c744908ea48af522 (diff) | |
download | volse-hubzilla-5e0f5460f2ee92aecc53fd900e55d54fa5326fc5.tar.gz volse-hubzilla-5e0f5460f2ee92aecc53fd900e55d54fa5326fc5.tar.bz2 volse-hubzilla-5e0f5460f2ee92aecc53fd900e55d54fa5326fc5.zip |
provide info about dead sites in delivery report and set site_dead when marking a hubloc down.
Diffstat (limited to 'include/hubloc.php')
-rw-r--r-- | include/hubloc.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/hubloc.php b/include/hubloc.php index 059a4dadc..6b896c627 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -247,6 +247,7 @@ function hubloc_change_primary($hubloc) { * * We use the post url to distinguish between http and https hublocs. * The https might be alive, and the http dead. + * Also set site_dead for the corresponding entry in the site table. * * @param string $posturl Hubloc callback url which to disable */ @@ -255,6 +256,13 @@ function hubloc_mark_as_down($posturl) { intval(HUBLOC_OFFLINE), dbesc($posturl) ); + + // extract the baseurl and set site.site_dead to match + $m = parse_url($posturl); + $h = $m['scheme'] . '://' . $m['host']; + $r = q("update site set site_dead = 1 where site_url = '%s'", + dbesc($h) + ); } |