From 8bf7925cfe8984dde77c989cd29ca9d87a7d32a3 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 2 Jul 2002 17:04:51 +0000 Subject: Only ping when pingit is set --- Echolot/Pinger.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Echolot/Pinger.pm b/Echolot/Pinger.pm index 9915269..6ffe729 100644 --- a/Echolot/Pinger.pm +++ b/Echolot/Pinger.pm @@ -1,7 +1,7 @@ package Echolot::Pinger; # (c) 2002 Peter Palfrader -# $Id: Pinger.pm,v 1.8 2002/07/02 13:57:09 weasel Exp $ +# $Id: Pinger.pm,v 1.9 2002/07/02 17:04:51 weasel Exp $ # =pod @@ -97,17 +97,19 @@ sub send_pings() { my @remailers = Echolot::Globals::get()->{'storage'}->get_remailers(); for my $remailer (@remailers) { + next unless $remailer->{'pingit'}; + my $address = $remailer->{'address'}; my $timemod = ($now / $call_intervall); my $this_call_id = $timemod % $send_every_n_calls; - my $this_remailer_id = makeHash($remailer) % $send_every_n_calls; + my $this_remailer_id = makeHash($address) % $send_every_n_calls; next unless ($this_call_id eq $this_remailer_id); - for my $type (Echolot::Globals::get()->{'storage'}->get_types($remailer)) { - for my $key (Echolot::Globals::get()->{'storage'}->get_keys($remailer, $type)) { - print "ping calling $type, $remailer, $key\n" if Echolot::Config::get()->{'verbose'}; - do_ping($type, $remailer, $key); + for my $type (Echolot::Globals::get()->{'storage'}->get_types($address)) { + for my $key (Echolot::Globals::get()->{'storage'}->get_keys($address, $type)) { + print "ping calling $type, $address, $key\n" if Echolot::Config::get()->{'verbose'}; + do_ping($type, $address, $key); } }; }; -- cgit v1.2.3