diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:05:56 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:05:56 +0300 |
commit | 4499fc92189905fde71139822d784ab7819b181c (patch) | |
tree | 4057f60b1af82b52649d05f79a804543c57ae6f4 /src/filter.c | |
parent | 7072f8548414cf0e88babd7556f1f893c93ba3dc (diff) | |
download | rspamd-4499fc92189905fde71139822d784ab7819b181c.tar.gz rspamd-4499fc92189905fde71139822d784ab7819b181c.zip |
* Finally get rid of stupid savepoints system and migrate to async events logic completely
Fix lua redis library.
Diffstat (limited to 'src/filter.c')
-rw-r--r-- | src/filter.c | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/src/filter.c b/src/filter.c index f4048955d..562f705e5 100644 --- a/src/filter.c +++ b/src/filter.c @@ -208,48 +208,6 @@ check_metric_is_spam (struct worker_task *task, struct metric *metric) return FALSE; } -static gint -continue_process_filters (struct worker_task *task) -{ - GList *cur; - gpointer item = task->save.item; - struct metric *metric; - - while (call_symbol_callback (task, task->cfg->cache, &item)) { - cur = task->cfg->metrics_list; - while (cur) { - metric = cur->data; - /* call_filter_by_name (task, filt->func_name, filt->type, SCRIPT_HEADER); */ - if (task->save.saved) { - task->save.entry = cur; - task->save.item = item; - return 0; - } - else if (!task->pass_all_filters && - metric->action == METRIC_ACTION_REJECT && - check_metric_is_spam (task, metric)) { - goto end; - } - cur = g_list_next (cur); - } - } - -end: - /* Process all statfiles */ - process_statfiles (task); - /* Call post filters */ - lua_call_post_filters (task); - task->state = WRITE_REPLY; - - if (task->fin_callback) { - task->fin_callback (task->fin_arg); - } - else { - rspamd_dispatcher_restore (task->dispatcher); - } - return 1; -} - gint process_filters (struct worker_task *task) { @@ -257,10 +215,6 @@ process_filters (struct worker_task *task) struct metric *metric; gpointer item = NULL; - if (task->save.saved) { - task->save.saved = 0; - return continue_process_filters (task); - } /* Check skip */ if (check_skip (task->cfg->views, task)) { task->is_skipped = TRUE; @@ -282,15 +236,10 @@ process_filters (struct worker_task *task) cur = task->cfg->metrics_list; while (cur) { metric = cur->data; - if (task->save.saved) { - task->save.entry = cur; - task->save.item = item; - return 0; - } - else if (!task->pass_all_filters && + if (!task->pass_all_filters && metric->action == METRIC_ACTION_REJECT && check_metric_is_spam (task, metric)) { - task->state = WRITE_REPLY; + check_session_pending (task->s); return 1; } cur = g_list_next (cur); |