aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/symbols_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-26 17:13:10 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-26 19:48:30 +0100
commit661f634db96c2c049439b5bd7afae5af232c6ae7 (patch)
tree5cf6992b9afb0eb14324daf20c0df022aa982fd5 /src/libserver/symbols_cache.c
parent1ca24ef40609f571241fc18151d8c8cc7ef02e78 (diff)
downloadrspamd-661f634db96c2c049439b5bd7afae5af232c6ae7.tar.gz
rspamd-661f634db96c2c049439b5bd7afae5af232c6ae7.zip
[Rework] Remove multiple metrics support from Rspamd
Diffstat (limited to 'src/libserver/symbols_cache.c')
-rw-r--r--src/libserver/symbols_cache.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c
index b0f63134a..51addf04f 100644
--- a/src/libserver/symbols_cache.c
+++ b/src/libserver/symbols_cache.c
@@ -1158,34 +1158,22 @@ rspamd_symbols_cache_metric_limit (struct rspamd_task *task,
struct cache_savepoint *cp)
{
struct rspamd_metric_result *res;
- GList *cur;
- struct rspamd_metric *metric;
double ms;
if (task->flags & RSPAMD_TASK_FLAG_PASS_ALL) {
return FALSE;
}
- cur = task->cfg->metrics_list;
-
if (cp->lim == 0.0) {
- /*
- * Look for metric that has the maximum reject score
- */
- while (cur) {
- metric = cur->data;
- res = g_hash_table_lookup (task->results, metric->name);
+ res = task->result;
- if (res) {
- ms = rspamd_task_get_required_score (task, res);
+ if (res) {
+ ms = rspamd_task_get_required_score (task, res);
- if (!isnan (ms) && cp->lim < ms) {
- cp->rs = res;
- cp->lim = ms;
- }
+ if (!isnan (ms) && cp->lim < ms) {
+ cp->rs = res;
+ cp->lim = ms;
}
-
- cur = g_list_next (cur);
}
}
@@ -1493,7 +1481,7 @@ rspamd_symbols_cache_make_checkpoint (struct rspamd_task *task,
checkpoint->pass = RSPAMD_CACHE_PASS_INIT;
task->checkpoint = checkpoint;
- rspamd_create_metric_result (task, DEFAULT_METRIC);
+ task->result = rspamd_create_metric_result (task);
return checkpoint;
}