aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-01-31 22:24:51 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-01-31 22:24:51 +0400
commit5c0f36dfe734e46d72e4afdfd71c05353e4df86d (patch)
tree8ed04921ae2a4ee18106b0ca8096641e12ed1c01 /src/filter.c
parent2d708971163dc99f9c29cc47e7d4f56a3af882c5 (diff)
downloadrspamd-5c0f36dfe734e46d72e4afdfd71c05353e4df86d.tar.gz
rspamd-5c0f36dfe734e46d72e4afdfd71c05353e4df86d.zip
Fixes to threading (still incomplete).
Diffstat (limited to 'src/filter.c')
-rw-r--r--src/filter.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/filter.c b/src/filter.c
index e4ba63f0f..cf8a63d0d 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -239,12 +239,14 @@ process_filters (struct worker_task *task)
if (!task->pass_all_filters &&
metric->action == METRIC_ACTION_REJECT &&
check_metric_is_spam (task, metric)) {
+ task->s->wanna_die = TRUE;
check_session_pending (task->s);
return 1;
}
cur = g_list_next (cur);
}
}
+ task->s->wanna_die = TRUE;
check_session_pending (task->s);
return 1;
@@ -623,6 +625,24 @@ process_statfiles (struct worker_task *task)
make_composites (task);
}
+void
+process_statfiles_threaded (gpointer data, gpointer user_data)
+{
+ struct worker_task *task = (struct worker_task *)data;
+
+ if (task->is_skipped) {
+ return;
+ }
+
+ if (task->tokens == NULL) {
+ task->tokens = g_hash_table_new (g_direct_hash, g_direct_equal);
+ memory_pool_add_destructor (task->task_pool, (pool_destruct_func)g_hash_table_unref, task->tokens);
+ }
+
+ g_list_foreach (task->cfg->classifiers, classifiers_callback, task);
+ remove_async_thread (task->s);
+}
+
static void
insert_metric_header (gpointer metric_name, gpointer metric_value, gpointer data)
{