commit 9794220: [Project] Support connection filters registration from Lua
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Oct 19 19:49:07 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-10-19 20:46:19 +0100
URL: https://github.com/rspamd/rspamd/commit/9794220fa8c50fe1d797a75da2e9b258f1079d90 (HEAD -> master)
[Project] Support connection filters registration from Lua
---
src/lua/lua_config.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 38c15bbe1..c59850c9d 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1817,22 +1817,32 @@ lua_parse_symbol_type (const gchar *str)
ret |= SYMBOL_TYPE_VIRTUAL;
ret &= ~SYMBOL_TYPE_NORMAL;
ret &= ~SYMBOL_TYPE_CALLBACK;
- } else if (g_ascii_strcasecmp (str, "callback") == 0) {
+ }
+ else if (g_ascii_strcasecmp (str, "callback") == 0) {
ret |= SYMBOL_TYPE_CALLBACK;
ret &= ~SYMBOL_TYPE_NORMAL;
ret &= ~SYMBOL_TYPE_VIRTUAL;
- } else if (g_ascii_strcasecmp (str, "normal") == 0) {
+ }
+ else if (g_ascii_strcasecmp (str, "normal") == 0) {
ret |= SYMBOL_TYPE_NORMAL;
ret &= ~SYMBOL_TYPE_CALLBACK;
ret &= ~SYMBOL_TYPE_VIRTUAL;
- } else if (g_ascii_strcasecmp (str, "prefilter") == 0) {
+ }
+ else if (g_ascii_strcasecmp (str, "prefilter") == 0) {
ret |= SYMBOL_TYPE_PREFILTER | SYMBOL_TYPE_GHOST;
- } else if (g_ascii_strcasecmp (str, "postfilter") == 0) {
+ }
+ else if (g_ascii_strcasecmp (str, "postfilter") == 0) {
ret |= SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST;
- } else if (g_ascii_strcasecmp (str, "idempotent") == 0) {
+ }
+ else if (g_ascii_strcasecmp (str, "connfilter") == 0 ||
+ g_ascii_strcasecmp (str, "conn_filter") == 0) {
+ ret |= SYMBOL_TYPE_CONNFILTER | SYMBOL_TYPE_GHOST;
+ }
+ else if (g_ascii_strcasecmp (str, "idempotent") == 0) {
ret |= SYMBOL_TYPE_POSTFILTER | SYMBOL_TYPE_GHOST |
- SYMBOL_TYPE_IDEMPOTENT | SYMBOL_TYPE_CALLBACK;
- } else {
+ SYMBOL_TYPE_IDEMPOTENT | SYMBOL_TYPE_CALLBACK;
+ }
+ else {
gint fl = 0;
fl = lua_parse_symbol_flags (str);
More information about the Commits
mailing list