X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXMsg.pm;h=b25b70a5b704c57f02ba863d88ca406a6bbdf651;hb=a23a8576e79859f0108072a9f780d1b3a9383278;hp=04ef99cb8ecffccfb21d7215b590a886497d2a8d;hpb=e26fa9333c620e741da9398478c4ad0a656f1ae7;p=spider.git diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 04ef99cb..b25b70a5 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -151,7 +151,10 @@ sub process } # clean the message queue - clean_old() if $main::systime - $last_clean > 3600 ; + if ($main::systime >= $last_clean+3600) { + clean_old(); + $last_clean = $main::systime; + } # actual remove all the 'deleted' messages in one hit. # this has to be delayed until here otherwise it only does one at @@ -161,7 +164,6 @@ sub process $_->del_msg; } - $last_clean = $main::systime; } # incoming message @@ -312,6 +314,14 @@ sub handle_32 $ref->store($ref->{lines}); } else { + # is it too old + if ($ref->{t}+$maxage < $main::systime ) { + $ref->stop_msg($fromnode); + dbg("old message from $ref->{from} -> $ref->{to} " . atime($ref->{t}) . " ignored") if isdbg('msg'); + Log('msg', "old message from $ref->{from} -> $ref->{to} " . cldatetime($ref->{t}) . " ignored"); + return; + } + # does an identical message already exist? my $m; for $m (@msg) { @@ -469,7 +479,7 @@ sub notify my $ref = shift; my $to = $ref->{to}; my $uref = DXUser->get_current($to); - my $dxchan = DXChannel->get($to); + my $dxchan = DXChannel::get($to); if (((*Net::SMTP && $email_server) || $email_prog) && $uref && $uref->wantemail) { my $email = $uref->email; if ($email) {