summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-18 18:58:08 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-18 18:58:08 +0300
commit765df5c44df7ee22f2a08702ed1047de5ff61d41 (patch)
treec61285b99f5e0ea182583d4259e61adac5ac7294
parentaff188f209a2f4a3c67525c6f40352dbe9e8d049 (diff)
downloadrspamd-765df5c44df7ee22f2a08702ed1047de5ff61d41.tar.gz
rspamd-765df5c44df7ee22f2a08702ed1047de5ff61d41.zip
Fix one shot behaviour.
-rw-r--r--src/filter.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/filter.c b/src/filter.c
index 68a43d1f9..ec7b5a5ed 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -84,7 +84,7 @@ insert_metric_result (struct worker_task *task, struct metric *metric, const gch
/* Add metric score */
- if (!single && (s = g_hash_table_lookup (metric_res->symbols, symbol)) != NULL) {
+ if ((s = g_hash_table_lookup (metric_res->symbols, symbol)) != NULL) {
if (s->options && opts && opts != s->options) {
/* Append new options */
s->options = g_list_concat (s->options, g_list_copy(opts));
@@ -97,9 +97,10 @@ insert_metric_result (struct worker_task *task, struct metric *metric, const gch
s->options = g_list_copy (opts);
memory_pool_add_destructor (task->task_pool, (pool_destruct_func) g_list_free, s->options);
}
-
- s->score += w;
- metric_res->score += w;
+ if (!single) {
+ s->score += w;
+ metric_res->score += w;
+ }
}
else {
s = memory_pool_alloc (task->task_pool, sizeof (struct symbol));