]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix several issues found
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Oct 2021 14:17:12 +0000 (15:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Oct 2021 14:17:12 +0000 (15:17 +0100)
src/libstat/backends/cdb_backend.cxx
src/libstat/stat_config.c
src/libstat/stat_process.c

index eb86c696414ea4f7353f1cc09d42ae95d0f92aa8..5e1ec243bf5ec1060a5a59131909f881eac3e6d0 100644 (file)
@@ -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;
        }
index 5f48cf1f9c7be5a68054bae8b8ba5a585df4b62a..d6fdc9673da5b2d2cbebc43d38388260d89583de 100644 (file)
@@ -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 {
index 35c9d1215642d09d0f9c4bfdf666530b420af972..338dc3034f95fee0d7ca234052ca6bf057e81850 100644 (file)
@@ -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;