diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-22 16:30:55 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-22 16:30:55 +0100 |
commit | 004a8cb98057fd802ed285a559b1ab0f5b3fda50 (patch) | |
tree | ad49c8f5191944034028333065d9779f64dc0992 /src/libserver | |
parent | 04a539f1333f7dfc3b1d6799b16956b576cad3cb (diff) | |
download | rspamd-004a8cb98057fd802ed285a559b1ab0f5b3fda50.tar.gz rspamd-004a8cb98057fd802ed285a559b1ab0f5b3fda50.zip |
[Minor] Additional safe guard when removing symbols
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/composites.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libserver/composites.c b/src/libserver/composites.c index 2ac820990..f7c31bb20 100644 --- a/src/libserver/composites.c +++ b/src/libserver/composites.c @@ -422,11 +422,7 @@ composites_remove_symbols (gpointer key, gpointer value, gpointer data) } } - if (has_valid_op) { - if (want_remove_symbol || want_forced) { - rd->ms->flags |= RSPAMD_SYMBOL_RESULT_IGNORED; - msg_debug_composites ("remove symbol %s", key); - } + if (has_valid_op && !(rd->ms->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) { if (want_remove_score || want_forced) { msg_debug_composites ("remove symbol weight for %s (was %.2f)", @@ -434,6 +430,11 @@ composites_remove_symbols (gpointer key, gpointer value, gpointer data) cd->metric_res->score -= rd->ms->score; rd->ms->score = 0.0; } + + if (want_remove_symbol || want_forced) { + rd->ms->flags |= RSPAMD_SYMBOL_RESULT_IGNORED; + msg_debug_composites ("remove symbol %s", key); + } } } |