aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-12 17:22:33 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-12 17:22:33 +0100
commit9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36 (patch)
treef68c936404bf6c5ab1e4e780dacb952f6882695c /src/lua/lua_config.c
parentaef19db4a81bcc40db2047c1c540f09f07fc9fd1 (diff)
downloadrspamd-9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36.tar.gz
rspamd-9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36.zip
Rework symbols weights.
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c18
1 files changed, 10 insertions, 8 deletions
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;