summaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-10-06 18:12:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-10-06 18:13:04 +0100
commitadedfbabb36a30576a090c2768cc6c6352327dd9 (patch)
treefcde4f1ba2a64fee789619da191584e57d119df2 /src/libstat/stat_process.c
parent34e24051282cab18f3da7a55d247bf61448defda (diff)
downloadrspamd-adedfbabb36a30576a090c2768cc6c6352327dd9.tar.gz
rspamd-adedfbabb36a30576a090c2768cc6c6352327dd9.zip
[Minor] More support of backend-less classifiers
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 228360fa6..7eeac00c1 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -306,8 +306,13 @@ rspamd_stat_backends_process (struct rspamd_stat_ctx *st_ctx,
for (i = 0; i < st_ctx->statfiles->len; i++) {
st = g_ptr_array_index (st_ctx->statfiles, i);
- bk_run = g_ptr_array_index (task->stat_runtimes, i);
cl = st->classifier;
+
+ if (cl->cfg->flags & RSPAMD_FLAG_CLASSIFIER_NO_BACKEND) {
+ continue;
+ }
+
+ bk_run = g_ptr_array_index (task->stat_runtimes, i);
g_assert (st != NULL);
if (bk_run != NULL) {
@@ -333,12 +338,19 @@ rspamd_stat_backends_post_process (struct rspamd_stat_ctx *st_ctx,
{
guint i;
struct rspamd_statfile *st;
+ struct rspamd_classifier *cl;
gpointer bk_run;
g_assert (task->stat_runtimes != NULL);
for (i = 0; i < st_ctx->statfiles->len; i++) {
st = g_ptr_array_index (st_ctx->statfiles, i);
+ cl = st->classifier;
+
+ if (cl->cfg->flags & RSPAMD_FLAG_CLASSIFIER_NO_BACKEND) {
+ continue;
+ }
+
bk_run = g_ptr_array_index (task->stat_runtimes, i);
g_assert (st != NULL);