diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-26 17:13:10 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-26 19:48:30 +0100 |
commit | 661f634db96c2c049439b5bd7afae5af232c6ae7 (patch) | |
tree | 5cf6992b9afb0eb14324daf20c0df022aa982fd5 /src/libmime/filter.c | |
parent | 1ca24ef40609f571241fc18151d8c8cc7ef02e78 (diff) | |
download | rspamd-661f634db96c2c049439b5bd7afae5af232c6ae7.tar.gz rspamd-661f634db96c2c049439b5bd7afae5af232c6ae7.zip |
[Rework] Remove multiple metrics support from Rspamd
Diffstat (limited to 'src/libmime/filter.c')
-rw-r--r-- | src/libmime/filter.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c index 4a1b8bcbc..b16018507 100644 --- a/src/libmime/filter.c +++ b/src/libmime/filter.c @@ -26,19 +26,20 @@ #define COMMON_PART_FACTOR 95 struct rspamd_metric_result * -rspamd_create_metric_result (struct rspamd_task *task, const gchar *name) +rspamd_create_metric_result (struct rspamd_task *task) { struct rspamd_metric_result *metric_res; struct rspamd_metric *metric; guint i; - metric_res = g_hash_table_lookup (task->results, name); + metric_res = task->result; if (metric_res != NULL) { return metric_res; } - metric = g_hash_table_lookup (task->cfg->metrics, name); + metric = task->cfg->default_metric; + if (metric == NULL) { return NULL; } @@ -64,8 +65,6 @@ rspamd_create_metric_result (struct rspamd_task *task, const gchar *name) } metric_res->action = METRIC_ACTION_MAX; - g_hash_table_insert (task->results, (gpointer) metric->name, - metric_res); return metric_res; } @@ -108,7 +107,7 @@ insert_metric_result (struct rspamd_task *task, const ucl_object_t *mobj, *sobj; gint max_shots; - metric_res = rspamd_create_metric_result (task, metric->name); + metric_res = rspamd_create_metric_result (task); sdef = g_hash_table_lookup (metric->symbols, symbol); if (sdef == NULL) { |