# HG changeset patch # User Matti Hamalainen # Date 1250367690 -10800 # Node ID 34dcb7462043592f5cd066d3fc23424045c3cd12 # Parent f22cfa7617530951923a7d4e341f752ebcf30ea0 Sanitize weeding of entries, separating blocklist weeding from global lists. diff -r f22cfa761753 -r 34dcb7462043 maltfilter --- a/maltfilter Sat Aug 15 23:11:20 2009 +0300 +++ b/maltfilter Sat Aug 15 23:21:30 2009 +0300 @@ -499,6 +499,7 @@ # Don't weed in report mode. return if ($reportmode); + # Weed blocked entries. my @mips = keys %blocklist; foreach my $mip (@mips) { if (defined($blocklist{$mip})) { @@ -509,6 +510,27 @@ } } } + + # Clean up old entries from other lists + foreach my $mip (keys %statlist) { + if (defined($statlist{$mip})) { + my $mtime = $statlist{$mip}{"date2"}; + if (!check_time($mtime) && !defined($blocklist{$mip})) { + mlog(3, "* Deleting stale $mip (".($mtime >= 0 ? scalar localtime($mtime) : $mtime).")\n"); + delete($statlist{$mip}); + } + } + } + + foreach my $mip (keys %ignorelist) { + if (defined($ignorelist{$mip})) { + my $mtime = $ignorelist{$mip}{"date2"}; + if (!check_time($mtime)) { + mlog(3, "* Deleting stale ignored $mip (".($mtime >= 0 ? scalar localtime($mtime) : $mtime).")\n"); + delete($ignorelist{$mip}); + } + } + } } ### Update one entry of