commit 923f93f: [Minor] Fix several issues found
Vsevolod Stakhov
vsevolod at highsecure.ru
Thu Oct 21 14:42:06 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-10-21 15:17:12 +0100
URL: https://github.com/rspamd/rspamd/commit/923f93fb6bad21c3a6edadca15e516daa05d1e5f
[Minor] Fix several issues found
---
src/libstat/backends/cdb_backend.cxx | 3 +++
src/libstat/stat_config.c | 4 ++--
src/libstat/stat_process.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/libstat/backends/cdb_backend.cxx b/src/libstat/backends/cdb_backend.cxx
index eb86c6964..5e1ec243b 100644
--- a/src/libstat/backends/cdb_backend.cxx
+++ b/src/libstat/backends/cdb_backend.cxx
@@ -111,6 +111,9 @@ public:
{
std::swap(st, other.st);
std::swap(db, other.db);
+ std::swap(loaded, other.loaded);
+ std::swap(learns_spam, other.learns_spam);
+ std::swap(learns_ham, other.learns_ham);
return *this;
}
diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c
index 5f48cf1f9..d6fdc9673 100644
--- a/src/libstat/stat_config.c
+++ b/src/libstat/stat_config.c
@@ -330,10 +330,10 @@ rspamd_stat_init (struct rspamd_config *cfg, struct ev_loop *ev_base)
st->classifier = cl;
st->stcf = stf;
- if (!(cl->cfg->flags & RSPAMD_FLAG_CLASSIFIER_NO_BACKEND) && bk) {
+ if (!(cl->cfg->flags & RSPAMD_FLAG_CLASSIFIER_NO_BACKEND)) {
st->backend = bk;
st->bkcf = bk->init (stat_ctx, cfg, st);
- msg_debug_config ("added backend %s for symbol %s",
+ msg_info_config ("added backend %s for symbol %s",
bk->name, stf->symbol);
}
else {
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 35c9d1215..338dc3034 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -314,7 +314,7 @@ rspamd_stat_preprocess (struct rspamd_stat_ctx *st_ctx,
continue;
}
- if (st->backend->read_only) {
+ if (is_learn && st->backend->read_only) {
/* Read only backend, skip it */
g_ptr_array_index (task->stat_runtimes, i) = NULL;
continue;
More information about the Commits
mailing list