aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Notifier.php33
1 files changed, 14 insertions, 19 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index 44f71e1df..368a9229d 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -529,16 +529,18 @@ class Notifier {
*/
- $hublist = []; // this provides an easily printable list for the logs
- $dhubs = []; // delivery hubs where we store our resulting unique array
- $keys = []; // array of keys to check uniquness for zot hubs
- $urls = []; // array of urls to check uniqueness of hubs from other networks
- $hub_env = []; // per-hub envelope so we don't broadcast the entire envelope to all
- $dead = []; // known dead hubs - report them as undeliverable
+ $hublist = []; // this provides an easily printable list for the logs
+ $dhubs = []; // delivery hubs where we store our resulting unique array
+ $keys = []; // array of keys to check uniquness for zot hubs
+ $urls = []; // array of urls to check uniqueness of hubs from other networks
+ $hub_env = []; // per-hub envelope so we don't broadcast the entire envelope to all
+ $dead_hosts = []; // known dead hubs - report them as undeliverable
foreach ($hubs as $hub) {
if (isset($hub['site_dead']) && intval($hub['site_dead'])) {
- $dead[] = $hub;
+ if(!in_array($hub['hubloc_host'], $dead_hosts)) {
+ $dead_hosts[] = $hub['hubloc_host'];
+ }
continue;
}
@@ -677,26 +679,19 @@ class Notifier {
do_delivery(self::$deliveries);
}
- if ($dead && is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) {
- $dead_hosts_processed = [];
- foreach ($dead as $deceased) {
- if(in_array($deceased['hubloc_host'], $dead_hosts_processed)) {
- continue;
- }
+ if ($dead_hosts && is_array($target_item) && (!$target_item['item_deleted']) && (!get_config('system', 'disable_dreport'))) {
+ foreach ($dead_hosts as $deceased_host) {
$r = q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue )
values ( '%s', '%s','%s','%s','%s','%s','%s','%s' ) ",
dbesc($target_item['mid']),
- dbesc($deceased['hubloc_host']),
- dbesc($deceased['hubloc_host']),
- dbesc($deceased['hubloc_host']),
+ dbesc($deceased_host),
+ dbesc($deceased_host),
+ dbesc($deceased_host),
dbesc('undeliverable/unresponsive site'),
dbesc(datetime_convert()),
dbesc(self::$channel['channel_hash']),
dbesc(new_uuid())
);
- if($r) {
- $dead_hosts_processed[] = $deceased['hubloc_host'];
- }
}
}