diff options
author | Peter Palfrader <peter@palfrader.org> | 2002-07-02 13:57:09 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2002-07-02 13:57:09 +0000 |
commit | fc4d413fded67385a76049684d335854149ecabf (patch) | |
tree | 87309917622a73136e8db707765a280035e1e1f6 /Echolot | |
parent | 86822cfae2329829c6673f2e48135b3c4f6fee0d (diff) |
Put back in some debugging output for --verbose
Diffstat (limited to 'Echolot')
-rw-r--r-- | Echolot/Pinger.pm | 4 | ||||
-rw-r--r-- | Echolot/Scheduler.pm | 4 | ||||
-rw-r--r-- | Echolot/Storage/File.pm | 16 |
3 files changed, 15 insertions, 9 deletions
diff --git a/Echolot/Pinger.pm b/Echolot/Pinger.pm index 523a69d..9915269 100644 --- a/Echolot/Pinger.pm +++ b/Echolot/Pinger.pm @@ -1,7 +1,7 @@ package Echolot::Pinger; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Pinger.pm,v 1.7 2002/06/20 04:29:38 weasel Exp $ +# $Id: Pinger.pm,v 1.8 2002/07/02 13:57:09 weasel Exp $ # =pod @@ -106,7 +106,7 @@ sub send_pings() { 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"; + print "ping calling $type, $remailer, $key\n" if Echolot::Config::get()->{'verbose'}; do_ping($type, $remailer, $key); } }; diff --git a/Echolot/Scheduler.pm b/Echolot/Scheduler.pm index 1d5735c..99730e1 100644 --- a/Echolot/Scheduler.pm +++ b/Echolot/Scheduler.pm @@ -1,7 +1,7 @@ package Echolot::Scheduler; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Scheduler.pm,v 1.6 2002/07/02 13:51:30 weasel Exp $ +# $Id: Scheduler.pm,v 1.7 2002/07/02 13:57:09 weasel Exp $ # =pod @@ -123,6 +123,7 @@ sub run($) { if ($task->{'start'} < $now) { warn("Task $task->{'name'} could not be started on time\n"); } else { + print "zZzZZzz at $now\n" if Echolot::Config::get()->{'verbose'}; sleep ($task->{'start'} - $now); }; @@ -137,6 +138,7 @@ sub run($) { warn("Task $task->{'name'} is not defined\n"); my $what = $self->{'tasks'}->{$name}->{'what'}; + print "Running $name at ".(time())." (scheduled for $now)\n" if Echolot::Config::get()->{'verbose'}; last if ($what eq 'exit'); &$what(); $self->schedule($name, $now + $self->{'tasks'}->{$name}->{'interval'}) if diff --git a/Echolot/Storage/File.pm b/Echolot/Storage/File.pm index cf0fdf4..116f8bd 100644 --- a/Echolot/Storage/File.pm +++ b/Echolot/Storage/File.pm @@ -1,7 +1,7 @@ package Echolot::Storage::File; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: File.pm,v 1.13 2002/07/02 13:51:00 weasel Exp $ +# $Id: File.pm,v 1.14 2002/07/02 13:57:09 weasel Exp $ # =pod @@ -369,9 +369,6 @@ sub get_pings($$$$$) { sub register_pingout($$$$) { my ($self, $remailer_addr, $type, $key, $sent_time) = @_; - #require Data::Dumper; - #print Data::Dumper->Dump( [ $self->{'PING_FHS'} ] ); - my $fh = $self->get_ping_fh($remailer_addr, $type, $key, 'out') or cluck ("$remailer_addr; type=$type; key=$key has no assigned filehandle for out pings"), return 0; @@ -383,6 +380,8 @@ sub register_pingout($$$$) { cluck("Error when writing to $remailer_addr; type=$type; key=$key; out pings: $!"), return 0; $fh->flush(); + print "registering pingout at $sent_time for $remailer_addr ($type; $key)\n" + if Echolot::Config::get()->{'verbose'}; return 1; }; @@ -427,6 +426,8 @@ sub register_pingdone($$$$$) { cluck("Error when writing to outgoing pings file for remailer $remailer_addr; key=$key file: $!"), return 0; $fh->flush(); + print "registering pingdone from $sent_time with latency $latency for $remailer_addr ($type; $key)\n" + if Echolot::Config::get()->{'verbose'}; return 1; }; @@ -530,7 +531,8 @@ sub add_address($$) { }; # FIXME logging and such - print "Adding address $addr\n"; + print "Adding address $addr\n" if + if Echolot::Config::get()->{'verbose'}; $self->{'METADATA'}->{'addresses'}->{$addr} = $remailer; }; @@ -788,7 +790,9 @@ sub expire($) { for my $type ( keys %{$self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'keys'}} ) { for my $key ( keys %{$self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'keys'}->{$type}} ) { if ($self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'keys'}->{$type}->{$key}->{'last_update'} < $expire_keys) { - print "Expiring $remailer_addr, key, $type, $key\n"; + # FIXME logging and such + print "Expiring $remailer_addr, key, $type, $key\n" + if Echolot::Config::get()->{'verbose'}; $self->pingdata_close_one($remailer_addr, $type, $key, 'delete'); delete $self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'keys'}->{$type}->{$key}; }; |