You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2013/02/18 02:24:49 UTC
svn commit: r1447117 -
/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Author: mmartinec
Date: Mon Feb 18 01:24:49 2013
New Revision: 1447117
URL: http://svn.apache.org/r1447117
Log:
got_hit() should clear the %{$self->{test_log_msgs}} even on early returns (like on multiple hits of a rule)
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm?rev=1447117&r1=1447116&r2=1447117&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm Mon Feb 18 01:24:49 2013
@@ -2374,8 +2374,6 @@ sub _handle_hit {
$self->_wrap_desc($desc,
3+length($rule)+length($score)+length($area), " " x 28),
($self->{test_log_msgs}->{LONG} || ''));
-
- %{$self->{test_log_msgs}} = (); # clear test logs
}
sub _wrap_desc {
@@ -2462,7 +2460,10 @@ sub got_hit {
# adding a hit does nothing if we don't have a score -- we probably
# shouldn't have run it in the first place
- return unless $score;
+ if (!$score) {
+ %{$self->{test_log_msgs}} = ();
+ return;
+ }
# ensure that rule values always result in an *increase*
# of $self->{tests_already_hit}->{$rule}:
@@ -2479,6 +2480,7 @@ sub got_hit {
my $already_hit = $self->{tests_already_hit}->{$rule} || 0;
# don't count hits multiple times, unless 'tflags multiple' is on
if ($already_hit && ($tflags_ref->{$rule}||'') !~ /\bmultiple\b/) {
+ %{$self->{test_log_msgs}} = ();
return;
}
@@ -2516,6 +2518,7 @@ sub got_hit {
}
}
+ %{$self->{test_log_msgs}} = (); # clear test logs
return 1;
}