aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/protocol.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-04 15:42:15 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-04 15:42:15 +0000
commit70c5a7b68850e825b29b12c672fda71e366f58ff (patch)
treef100c3558bdf7cbcff45d7156ea5681c4ab4c60a /src/libserver/protocol.c
parentcc2301c1517da93dfe0867a5a91bafae18001e1a (diff)
downloadrspamd-70c5a7b68850e825b29b12c672fda71e366f58ff.tar.gz
rspamd-70c5a7b68850e825b29b12c672fda71e366f58ff.zip
[Rework] Kill metrics!11
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r--src/libserver/protocol.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 25fb56a0f..5e5132e1d 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -740,7 +740,7 @@ rspamd_emails_tree_ucl (GHashTable *input, struct rspamd_task *task)
/* Write new subject */
static const gchar *
-make_rewritten_subject (struct rspamd_metric *metric, struct rspamd_task *task)
+make_rewritten_subject (struct rspamd_task *task)
{
GString *subj_buf;
gchar *res;
@@ -750,7 +750,7 @@ make_rewritten_subject (struct rspamd_metric *metric, struct rspamd_task *task)
c = rspamd_mempool_get_variable (task->task_pool, "metric_subject");
if (c == NULL) {
- c = metric->subject;
+ c = task->cfg->subject;
}
if (c == NULL) {
@@ -797,8 +797,7 @@ make_rewritten_subject (struct rspamd_metric *metric, struct rspamd_task *task)
}
static ucl_object_t *
-rspamd_metric_symbol_ucl (struct rspamd_task *task, struct rspamd_metric *m,
- struct rspamd_symbol_result *sym)
+rspamd_metric_symbol_ucl (struct rspamd_task *task, struct rspamd_symbol_result *sym)
{
ucl_object_t *obj = NULL, *ar;
const gchar *description = NULL;
@@ -849,15 +848,12 @@ rspamd_metric_result_ucl (struct rspamd_task *task,
{
GHashTableIter hiter;
struct rspamd_symbol_result *sym;
- struct rspamd_metric *m;
gboolean is_spam;
- enum rspamd_metric_action action = METRIC_ACTION_NOACTION;
+ enum rspamd_action_type action = METRIC_ACTION_NOACTION;
ucl_object_t *obj = NULL, *sobj;
gpointer h, v;
const gchar *subject;
- m = mres->metric;
-
if (mres->action == METRIC_ACTION_MAX) {
mres->action = rspamd_check_action_metric (task, mres);
}
@@ -895,7 +891,7 @@ rspamd_metric_result_ucl (struct rspamd_task *task,
"action", 0, false);
if (action == METRIC_ACTION_REWRITE_SUBJECT) {
- subject = make_rewritten_subject (m, task);
+ subject = make_rewritten_subject (task);
if (subject) {
ucl_object_insert_key (obj, ucl_object_fromstring (subject),
@@ -912,7 +908,7 @@ rspamd_metric_result_ucl (struct rspamd_task *task,
while (g_hash_table_iter_next (&hiter, &h, &v)) {
sym = (struct rspamd_symbol_result *)v;
- sobj = rspamd_metric_symbol_ucl (task, m, sym);
+ sobj = rspamd_metric_symbol_ucl (task, sym);
ucl_object_insert_key (obj, sobj, h, 0, false);
}