commit 42116dc: [Minor] Core: Fix disabling of symbols

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Dec 27 18:28:09 UTC 2018


Author: Vsevolod Stakhov
Date: 2018-12-16 17:10:17 +0000
URL: https://github.com/rspamd/rspamd/commit/42116dc41f8d4141f11489298c811683b7ef7cf7

[Minor] Core: Fix disabling of symbols

---
 src/libserver/rspamd_symcache.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c
index 2eff43826..62340af3b 100644
--- a/src/libserver/rspamd_symcache.c
+++ b/src/libserver/rspamd_symcache.c
@@ -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);
+				}
 			}
 		}
 	}


More information about the Commits mailing list