aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/composites.c2
-rw-r--r--src/libserver/protocol.c6
-rw-r--r--src/libserver/roll_history.c4
-rw-r--r--src/libserver/task.c6
4 files changed, 14 insertions, 4 deletions
diff --git a/src/libserver/composites.c b/src/libserver/composites.c
index 67ed71149..2ac820990 100644
--- a/src/libserver/composites.c
+++ b/src/libserver/composites.c
@@ -424,7 +424,7 @@ composites_remove_symbols (gpointer key, gpointer value, gpointer data)
if (has_valid_op) {
if (want_remove_symbol || want_forced) {
- g_hash_table_remove (cd->metric_res->symbols, key);
+ rd->ms->flags |= RSPAMD_SYMBOL_RESULT_IGNORED;
msg_debug_composites ("remove symbol %s", key);
}
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 51b2fa0e5..0e4f9cb0c 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -970,8 +970,10 @@ 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, sym);
- ucl_object_insert_key (obj, sobj, h, 0, false);
+ if (!(sym->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) {
+ sobj = rspamd_metric_symbol_ucl (task, sym);
+ ucl_object_insert_key (obj, sobj, h, 0, false);
+ }
}
if (task->cmd == CMD_CHECK_V2) {
diff --git a/src/libserver/roll_history.c b/src/libserver/roll_history.c
index 04f2da0c6..6dbd4d338 100644
--- a/src/libserver/roll_history.c
+++ b/src/libserver/roll_history.c
@@ -77,6 +77,10 @@ roll_history_symbols_callback (gpointer key, gpointer value, void *user_data)
struct rspamd_symbol_result *s = value;
guint wr;
+ if (s->flags & RSPAMD_SYMBOL_RESULT_IGNORED) {
+ return;
+ }
+
if (cb->remain > 0) {
wr = rspamd_snprintf (cb->pos, cb->remain, "%s, ", s->name);
cb->pos += wr;
diff --git a/src/libserver/task.c b/src/libserver/task.c
index f626a8c7b..d881c6897 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -1087,7 +1087,11 @@ rspamd_task_log_metric_res (struct rspamd_task *task,
sorted_symbols = g_ptr_array_sized_new (g_hash_table_size (mres->symbols));
while (g_hash_table_iter_next (&it, &k, &v)) {
- g_ptr_array_add (sorted_symbols, v);
+ sym = v;
+
+ if (!(sym->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) {
+ g_ptr_array_add (sorted_symbols, v);
+ }
}
g_ptr_array_sort (sorted_symbols, rspamd_task_compare_log_sym);