struct rspamd_composite *ncomp;
struct rspamd_task *task = cd->task;
- if ((ms = rspamd_task_find_symbol_result (cd->task, sym, NULL)) == NULL) {
+ if ((ms = rspamd_task_find_symbol_result (cd->task, sym, cd->metric_res)) == NULL) {
msg_debug_composites ("not found symbol %s in composite %s", sym,
cd->composite->sym);
if ((ncomp =
cd->composite = saved;
clrbit (cd->checked, cd->composite->id * 2);
- ms = rspamd_task_find_symbol_result (cd->task, sym, NULL);
+ ms = rspamd_task_find_symbol_result (cd->task, sym,
+ cd->metric_res);
}
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, NULL);
+ ms = rspamd_task_find_symbol_result (cd->task, sym,
+ cd->metric_res);
}
}
}
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, NULL);
+ ms = rspamd_task_find_symbol_result (cd->task, sym, cd->metric_res);
}
if (ms) {
clrbit (cd->checked, comp->id * 2 + 1);
}
else {
- if (rspamd_task_find_symbol_result (cd->task, key, NULL) != NULL) {
+ if (rspamd_task_find_symbol_result (cd->task, key,
+ cd->metric_res) != NULL) {
/* Already set, no need to check */
msg_debug_composites ("composite %s is already in metric "
"in composites bitfield", cd->composite->sym);
}
}
- ms = rspamd_task_find_symbol_result (task, rd->sym, NULL);
+ ms = rspamd_task_find_symbol_result (task, rd->sym, cd->metric_res);
if (has_valid_op && ms && !(ms->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) {
}
void
-rspamd_make_composites (struct rspamd_task *task)
+rspamd_composites_process_task (struct rspamd_task *task)
{
if (task->result && !RSPAMD_TASK_IS_SKIPPED (task)) {
- composites_metric_callback (task->result, task);
+ struct rspamd_scan_result *mres;
+
+ DL_FOREACH (task->result, mres) {
+ composites_metric_callback (mres, task);
+ }
}
}