diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-08-12 17:22:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-08-12 17:22:33 +0100 |
commit | 9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36 (patch) | |
tree | f68c936404bf6c5ab1e4e780dacb952f6882695c /src/lua | |
parent | aef19db4a81bcc40db2047c1c540f09f07fc9fd1 (diff) | |
download | rspamd-9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36.tar.gz rspamd-9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36.zip |
Rework symbols weights.
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_cfg_file.c | 2 | ||||
-rw-r--r-- | src/lua/lua_config.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c index 563fbb77b..a8e8dfbb8 100644 --- a/src/lua/lua_cfg_file.c +++ b/src/lua/lua_cfg_file.c @@ -213,7 +213,7 @@ rspamd_lua_post_load_config (struct rspamd_config *cfg) else { g_hash_table_insert (cfg->composite_symbols, sym, expr); rspamd_symbols_cache_add_symbol (cfg->cache, sym, - 1, 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1); + 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1); } } } diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index a1033543d..ea84f5532 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -920,7 +920,6 @@ rspamd_register_symbol_fromlua (lua_State *L, ret = rspamd_symbols_cache_add_symbol (cfg->cache, name, - weight, priority, lua_metric_symbol_callback, cd, @@ -1012,16 +1011,18 @@ lua_config_register_symbols (lua_State *L) while (lua_next (L, -2)) { lua_pushvalue (L, -2); sym = luaL_checkstring (L, -2); - rspamd_symbols_cache_add_symbol_virtual (cfg->cache, sym, - weight, ret); + rspamd_symbols_cache_add_symbol (cfg->cache, sym, + 0, NULL, NULL, + SYMBOL_TYPE_VIRTUAL, ret); lua_pop (L, 2); } lua_pop (L, 1); } else if (lua_type (L, i) == LUA_TSTRING) { sym = luaL_checkstring (L, i); - rspamd_symbols_cache_add_symbol_virtual (cfg->cache, sym, - weight, ret); + rspamd_symbols_cache_add_symbol (cfg->cache, sym, + 0, NULL, NULL, + SYMBOL_TYPE_VIRTUAL, ret); } } } @@ -1048,8 +1049,9 @@ lua_config_register_virtual_symbol (lua_State * L) } if (name) { - ret = rspamd_symbols_cache_add_symbol_virtual (cfg->cache, name, - weight, parent); + ret = rspamd_symbols_cache_add_symbol (cfg->cache, name, + 0, NULL, NULL, + SYMBOL_TYPE_VIRTUAL, parent); } } @@ -1257,7 +1259,7 @@ lua_config_add_composite (lua_State * L) if (new) { rspamd_symbols_cache_add_symbol (cfg->cache, name, - 1, 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1); + 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1); } ret = TRUE; |