From: minima Date: Sat, 5 Feb 2005 18:10:37 +0000 (+0000) Subject: fix bull age deletion both periodically and on new entry X-Git-Tag: R_1_52~211 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=e4366c330ee2e359f1a2404f9ff35075e81165cc fix bull age deletion both periodically and on new entry --- diff --git a/Changes b/Changes index 331ae540..eabf6097 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +05Feb05======================================================================= +1. Fix a long standing (ie since the first bulletin was sent) bug with old +mail not being deleted until a restart was done. +2. As well as a duplicate check on existing bulletins, I have added a check +the message is not (already) too old. 03Feb05======================================================================= 1. Added latest Spanish translations courtesy of Angel EA7WA. 2. Force all languages to use pr in en in Messages, as the prompt is diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 04ef99cb..67165ef4 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) {