aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-29 15:16:17 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-29 15:16:17 +0000
commit84bba58ac10018f5ad541331ad3b84ea1b1119b6 (patch)
tree1785fe89a944bba739fa3998000a19708fe8e2ab /src/libserver
parentb96c9874f31667f4849088deb87e5da7df0575b0 (diff)
downloadrspamd-84bba58ac10018f5ad541331ad3b84ea1b1119b6.tar.gz
rspamd-84bba58ac10018f5ad541331ad3b84ea1b1119b6.zip
Add substages for classification
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/task.c4
-rw-r--r--src/libserver/task.h15
2 files changed, 13 insertions, 6 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c
index 758b90807..4f3a9d72c 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -440,7 +440,9 @@ rspamd_task_process (struct rspamd_task *task, guint stages)
break;
case RSPAMD_TASK_STAGE_CLASSIFIERS:
- if (rspamd_stat_classify (task, task->cfg->lua_state, &stat_error) ==
+ case RSPAMD_TASK_STAGE_CLASSIFIERS_PRE:
+ case RSPAMD_TASK_STAGE_CLASSIFIERS_POST:
+ if (rspamd_stat_classify (task, task->cfg->lua_state, st, &stat_error) ==
RSPAMD_STAT_PROCESS_ERROR) {
msg_err_task ("classify error: %e", stat_error);
g_error_free (stat_error);
diff --git a/src/libserver/task.h b/src/libserver/task.h
index 2047d701c..359b2f41f 100644
--- a/src/libserver/task.h
+++ b/src/libserver/task.h
@@ -60,11 +60,13 @@ enum rspamd_task_stage {
RSPAMD_TASK_STAGE_READ_MESSAGE = (1 << 2),
RSPAMD_TASK_STAGE_PRE_FILTERS = (1 << 3),
RSPAMD_TASK_STAGE_FILTERS = (1 << 4),
- RSPAMD_TASK_STAGE_CLASSIFIERS = (1 << 5),
- RSPAMD_TASK_STAGE_COMPOSITES = (1 << 6),
- RSPAMD_TASK_STAGE_POST_FILTERS = (1 << 7),
- RSPAMD_TASK_STAGE_DONE = (1 << 8),
- RSPAMD_TASK_STAGE_REPLIED = (1 << 9)
+ RSPAMD_TASK_STAGE_CLASSIFIERS_PRE = (1 << 5),
+ RSPAMD_TASK_STAGE_CLASSIFIERS = (1 << 6),
+ RSPAMD_TASK_STAGE_CLASSIFIERS_POST = (1 << 7),
+ RSPAMD_TASK_STAGE_COMPOSITES = (1 << 8),
+ RSPAMD_TASK_STAGE_POST_FILTERS = (1 << 9),
+ RSPAMD_TASK_STAGE_DONE = (1 << 10),
+ RSPAMD_TASK_STAGE_REPLIED = (1 << 11)
};
#define RSPAMD_TASK_PROCESS_ALL (RSPAMD_TASK_STAGE_CONNECT | \
@@ -72,7 +74,9 @@ enum rspamd_task_stage {
RSPAMD_TASK_STAGE_READ_MESSAGE | \
RSPAMD_TASK_STAGE_PRE_FILTERS | \
RSPAMD_TASK_STAGE_FILTERS | \
+ RSPAMD_TASK_STAGE_CLASSIFIERS_PRE | \
RSPAMD_TASK_STAGE_CLASSIFIERS | \
+ RSPAMD_TASK_STAGE_CLASSIFIERS_POST | \
RSPAMD_TASK_STAGE_COMPOSITES | \
RSPAMD_TASK_STAGE_POST_FILTERS | \
RSPAMD_TASK_STAGE_DONE)
@@ -154,6 +158,7 @@ struct rspamd_task {
GList *messages; /**< list of messages that would be reported */
struct rspamd_re_runtime *re_rt; /**< regexp runtime */
+ GList *cl_runtimes; /**< classifiers runtime */
struct rspamd_config *cfg; /**< pointer to config object */
GError *err;
rspamd_mempool_t *task_pool; /**< memory pool for task */