diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-07 21:22:34 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-07 21:22:34 +0100 |
commit | e9418b12ff5cab4c366af3751906f5e95ba3df7a (patch) | |
tree | f83defcc32c8d172d536986d92df9a00a25a9227 /src/libserver | |
parent | e7c1a6a9a153a5832fd7748927961949b63728cb (diff) | |
download | rspamd-e9418b12ff5cab4c366af3751906f5e95ba3df7a.tar.gz rspamd-e9418b12ff5cab4c366af3751906f5e95ba3df7a.zip |
[Project] Rework scan result functions to support shadow results
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/composites.c | 12 | ||||
-rw-r--r-- | src/libserver/roll_history.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libserver/composites.c b/src/libserver/composites.c index 22fe45818..c35ba2431 100644 --- a/src/libserver/composites.c +++ b/src/libserver/composites.c @@ -201,7 +201,7 @@ rspamd_composite_process_single_symbol (struct composites_data *cd, struct rspamd_composite *ncomp; struct rspamd_task *task = cd->task; - if ((ms = rspamd_task_find_symbol_result (cd->task, sym)) == NULL) { + if ((ms = rspamd_task_find_symbol_result (cd->task, sym, NULL)) == NULL) { msg_debug_composites ("not found symbol %s in composite %s", sym, cd->composite->sym); if ((ncomp = @@ -225,14 +225,14 @@ rspamd_composite_process_single_symbol (struct composites_data *cd, cd->composite = saved; clrbit (cd->checked, cd->composite->id * 2); - ms = rspamd_task_find_symbol_result (cd->task, sym); + ms = rspamd_task_find_symbol_result (cd->task, sym, NULL); } else { /* * XXX: in case of cyclic references this would return 0 */ if (isset (cd->checked, ncomp->id * 2 + 1)) { - ms = rspamd_task_find_symbol_result (cd->task, sym); + ms = rspamd_task_find_symbol_result (cd->task, sym, NULL); } } } @@ -396,7 +396,7 @@ rspamd_composite_expr_process (void *ud, if (isset (cd->checked, cd->composite->id * 2)) { /* We have already checked this composite, so just return its value */ if (isset (cd->checked, cd->composite->id * 2 + 1)) { - ms = rspamd_task_find_symbol_result (cd->task, sym); + ms = rspamd_task_find_symbol_result (cd->task, sym, NULL); } if (ms) { @@ -563,7 +563,7 @@ composites_foreach_callback (gpointer key, gpointer value, void *data) clrbit (cd->checked, comp->id * 2 + 1); } else { - if (rspamd_task_find_symbol_result (cd->task, key) != NULL) { + if (rspamd_task_find_symbol_result (cd->task, key, NULL) != NULL) { /* Already set, no need to check */ msg_debug_composites ("composite %s is already in metric " "in composites bitfield", cd->composite->sym); @@ -652,7 +652,7 @@ composites_remove_symbols (gpointer key, gpointer value, gpointer data) } } - ms = rspamd_task_find_symbol_result (task, rd->sym); + ms = rspamd_task_find_symbol_result (task, rd->sym, NULL); if (has_valid_op && ms && !(ms->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) { diff --git a/src/libserver/roll_history.c b/src/libserver/roll_history.c index a0197a32c..6add06e62 100644 --- a/src/libserver/roll_history.c +++ b/src/libserver/roll_history.c @@ -165,7 +165,7 @@ rspamd_roll_history_update (struct roll_history *history, row->required_score = rspamd_task_get_required_score (task, metric_res); cbdata.pos = row->symbols; cbdata.remain = sizeof (row->symbols); - rspamd_task_symbol_result_foreach (task, + rspamd_task_symbol_result_foreach (task, NULL, roll_history_symbols_callback, &cbdata); if (cbdata.remain > 0) { |