summaryrefslogtreecommitdiffstats
path: root/src/filter.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-30 18:32:11 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-06-30 18:32:11 +0400
commit9e6acadd7ce323f42ebed02237d064305df32249 (patch)
tree11ecda90995e02204d5f14c1fcabee893bdceab3 /src/filter.c
parentb3c36d4946f675619b81c9223f5ac1a86c55c55c (diff)
downloadrspamd-9e6acadd7ce323f42ebed02237d064305df32249.tar.gz
rspamd-9e6acadd7ce323f42ebed02237d064305df32249.zip
* Improve performance of settings lookup
Diffstat (limited to 'src/filter.c')
-rw-r--r--src/filter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/filter.c b/src/filter.c
index b625e4c72..b48bf64ba 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -67,6 +67,9 @@ insert_metric_result (struct worker_task *task, struct metric *metric, const gch
metric_res->metric = metric;
metric_res->grow_factor = 0;
metric_res->score = 0;
+ metric_res->domain_settings = NULL;
+ metric_res->user_settings = NULL;
+ apply_metric_settings (task, metric, metric_res);
g_hash_table_insert (task->results, (gpointer) metric->name, metric_res);
}
@@ -238,7 +241,7 @@ check_metric_is_spam (struct worker_task *task, struct metric *metric)
res = g_hash_table_lookup (task->results, metric->name);
if (res) {
- if (!check_metric_settings (task, metric, &ms, &rs)) {
+ if (!check_metric_settings (res, &ms, &rs)) {
ms = metric->required_score;
}
return res->score >= ms;
@@ -706,7 +709,7 @@ insert_metric_header (gpointer metric_name, gpointer metric_value, gpointer data
rspamd_snprintf (header_name, sizeof (header_name), "X-Spam-%s", metric_res->metric->name);
- if (!check_metric_settings (task, metric_res->metric, &ms, &rs)) {
+ if (!check_metric_settings (metric_res, &ms, &rs)) {
ms = metric_res->metric->required_score;
}
if (metric_res->score >= ms) {