summaryrefslogtreecommitdiffstats
path: root/src/libstat
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-09 09:38:03 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-09 09:38:03 +0100
commit76c9863e1049b000315589cbf162977188a9e16d (patch)
tree32bc4db2e3aac2b2a211cd38068eb1bfd0beba0d /src/libstat
parent65c174b0c308cdfcb50830279a6cbea0a6d00073 (diff)
downloadrspamd-76c9863e1049b000315589cbf162977188a9e16d.tar.gz
rspamd-76c9863e1049b000315589cbf162977188a9e16d.zip
Skip missing statfiles on classifying.
Diffstat (limited to 'src/libstat')
-rw-r--r--src/libstat/stat_process.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 588beb972..978264ac4 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -219,13 +219,22 @@ rspamd_stat_preprocess (struct rspamd_stat_ctx *st_ctx,
backend_runtime = bk->runtime (task, stcf, op != RSPAMD_CLASSIFY_OP,
bk->ctx);
- if (backend_runtime == NULL && op != RSPAMD_CLASSIFY_OP) {
- /* Assume backend absence as fatal error */
- g_set_error (err, rspamd_stat_quark(), 500,
- "cannot open backend for statfile %s", stcf->symbol);
- g_list_free (cl_runtimes);
-
- return NULL;
+ if (backend_runtime == NULL) {
+ if (op != RSPAMD_CLASSIFY_OP) {
+ /* Assume backend absence as fatal error */
+ g_set_error (err, rspamd_stat_quark(), 500,
+ "cannot open backend for statfile %s", stcf->symbol);
+ g_list_free (cl_runtimes);
+
+ return NULL;
+ }
+ else {
+ /* Just skip this element */
+ msg_warn ("backend of type %s does not exist: %s",
+ stcf->backend, stcf->symbol);
+ curst = g_list_next (curst);
+ continue;
+ }
}
st_runtime = rspamd_mempool_alloc0 (task->task_pool,