From d1b3e972600c84dd8cf986a7c7fb59deb29f4aef Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 13 Jul 2002 21:11:52 +0000 Subject: redid some parts of expireing --- Echolot/Storage/File.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Echolot/Storage/File.pm b/Echolot/Storage/File.pm index 3c78ae5..fed07e3 100644 --- a/Echolot/Storage/File.pm +++ b/Echolot/Storage/File.pm @@ -1,7 +1,7 @@ package Echolot::Storage::File; # (c) 2002 Peter Palfrader -# $Id: File.pm,v 1.35 2002/07/13 20:35:50 weasel Exp $ +# $Id: File.pm,v 1.36 2002/07/13 21:11:52 weasel Exp $ # =pod @@ -664,10 +664,17 @@ sub restore_ttl($$) { sub not_a_remailer($$) { my ($self, $id) = @_; - my $address = $self->get_address_by_id($id); - cluck("No remailer found for id '$id'"), return 0 unless defined $address; + my $remailer = $self->get_address_by_id($id); + cluck("No remailer found for id '$id'"), return 0 unless defined $remailer; + my $address = $remailer->{'address'}; + defined ($self->{'METADATA'}->{'addresses'}->{$address}) or + cluck ("$address does not exist in Metadata address list"), + return 0; + $self->{'METADATA'}->{'addresses'}->{$address}->{'status'} = 'disabled by user reply: is not a remailer'; + + print "Setting $id, $address to disabled by user reply\n" + if Echolot::Config::get()->{'verbose'}; - delete $self->{'METADATA'}->{'addresses'}->{$address}->{'disabled by user reply: is not a remailer'}; $self->commit(); return 1; }; @@ -888,8 +895,6 @@ sub expire($) { my $expire_pings = $now - Echolot::Config::get()->{'expire_pings'}; for my $remailer_addr ( keys %{$self->{'METADATA'}->{'remailers'}} ) { - next unless ($self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'status'} eq 'active'); - 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) { @@ -911,7 +916,8 @@ sub expire($) { ($self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'conf'}->{'last_update'} < $expire_conf) && ! ($self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'conf'}->{'dont_expire'})); - $self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'status'} = 'expired' + delete $self->{'METADATA'}->{'remailers'}->{$remailer_addr}, + next unless ( defined ($self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'conf'}) || defined ($self->{'METADATA'}->{'remailers'}->{$remailer_addr}->{'keys'})); -- cgit v1.2.3