aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-09-19 20:29:58 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-09-19 20:29:58 +0400
commit91d183b8f4719ecc6b339cc3e8d9239bf7594e30 (patch)
treee4a548ed5570d425d87ac0aa684900179eaabe4e /src/lua/lua_config.c
parent1bdd1f05773d1f16f4fc271e09a691a1750e0ed5 (diff)
downloadrspamd-91d183b8f4719ecc6b339cc3e8d9239bf7594e30.tar.gz
rspamd-91d183b8f4719ecc6b339cc3e8d9239bf7594e30.zip
Avoid global variables in map logic.
* Add support of simple maps like '/path/to/file' as it seems to be more comfortable than 'file:///...'
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index d6db81309..ba9dfab37 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -567,7 +567,7 @@ lua_config_add_radix_map (lua_State *L)
map_line = luaL_checkstring (L, 2);
r = memory_pool_alloc (cfg->cfg_pool, sizeof (radix_tree_t *));
*r = radix_tree_create ();
- if (!add_map (map_line, read_radix_list, fin_radix_list, (void **)r)) {
+ if (!add_map (cfg, map_line, read_radix_list, fin_radix_list, (void **)r)) {
msg_warn ("invalid radix map %s", map_line);
radix_tree_free (*r);
lua_pushnil (L);
@@ -596,7 +596,7 @@ lua_config_add_hash_map (lua_State *L)
map_line = luaL_checkstring (L, 2);
r = memory_pool_alloc (cfg->cfg_pool, sizeof (GHashTable *));
*r = g_hash_table_new (rspamd_strcase_hash, rspamd_strcase_equal);
- if (!add_map (map_line, read_host_list, fin_host_list, (void **)r)) {
+ if (!add_map (cfg, map_line, read_host_list, fin_host_list, (void **)r)) {
msg_warn ("invalid hash map %s", map_line);
g_hash_table_destroy (*r);
lua_pushnil (L);
@@ -626,7 +626,7 @@ lua_config_add_kv_map (lua_State *L)
map_line = luaL_checkstring (L, 2);
r = memory_pool_alloc (cfg->cfg_pool, sizeof (GHashTable *));
*r = g_hash_table_new (rspamd_strcase_hash, rspamd_strcase_equal);
- if (!add_map (map_line, read_kv_list, fin_kv_list, (void **)r)) {
+ if (!add_map (cfg, map_line, read_kv_list, fin_kv_list, (void **)r)) {
msg_warn ("invalid hash map %s", map_line);
g_hash_table_destroy (*r);
lua_pushnil (L);