]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Core: Fix disabling of symbols
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 16 Dec 2018 17:10:17 +0000 (17:10 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 16 Dec 2018 17:10:17 +0000 (17:10 +0000)
src/libserver/rspamd_symcache.c

index 2eff4382645e95fb29deedadea18042e2b7554c5..62340af3b096992f6f227889d4f0c163564d85b3 100644 (file)
@@ -2532,7 +2532,7 @@ rspamd_symcache_enable_symbol (struct rspamd_task *task,
                if (item) {
                        dyn_item = rspamd_symcache_get_dynamic (checkpoint, item);
 
-                       if (CHECK_FINISH_BIT (checkpoint, dyn_item)) {
+                       if (!CHECK_FINISH_BIT (checkpoint, dyn_item)) {
                                ret = TRUE;
                                CLR_START_BIT (checkpoint, dyn_item);
                                CLR_FINISH_BIT (checkpoint, dyn_item);
@@ -2568,13 +2568,16 @@ rspamd_symcache_disable_symbol (struct rspamd_task *task,
                if (item) {
                        dyn_item = rspamd_symcache_get_dynamic (checkpoint, item);
 
-                       if (CHECK_START_BIT (checkpoint, dyn_item)) {
+                       if (!CHECK_START_BIT (checkpoint, dyn_item)) {
                                ret = TRUE;
                                SET_START_BIT (checkpoint, dyn_item);
                                SET_FINISH_BIT (checkpoint, dyn_item);
                        }
                        else {
-                               msg_warn_task ("cannot disable symbol %s: already started", symbol);
+                               if (!CHECK_FINISH_BIT (checkpoint, dyn_item)) {
+                                       msg_warn_task ("cannot disable symbol %s: already started",
+                                                       symbol);
+                               }
                        }
                }
        }