aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 22:08:09 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 22:08:09 +0100
commit6d230abb527752ef25e352d8d09669020774e75f (patch)
treeb68a6c445d6cfca183c84ef34034152a68d97440 /src/lua/lua_util.c
parent2401ecfcf47963d1d7ac24f5d958a61d28771655 (diff)
downloadrspamd-6d230abb527752ef25e352d8d09669020774e75f.tar.gz
rspamd-6d230abb527752ef25e352d8d09669020774e75f.zip
Adopt lua API.
Diffstat (limited to 'src/lua/lua_util.c')
-rw-r--r--src/lua/lua_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index d93811dae..297ee406d 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -104,6 +104,7 @@ lua_util_load_rspamd_config (lua_State *L)
if (cfg_name) {
cfg = g_malloc0 (sizeof (struct rspamd_config));
rspamd_init_cfg (cfg, FALSE);
+ cfg->cache = rspamd_symbols_cache_new ();
if (rspamd_config_read (cfg, cfg_name, NULL, NULL, NULL)) {
msg_err ("cannot load config from %s", cfg_name);
@@ -111,7 +112,7 @@ lua_util_load_rspamd_config (lua_State *L)
}
else {
rspamd_config_post_load (cfg);
- init_symbols_cache (cfg->cfg_pool, cfg->cache, cfg, NULL, TRUE);
+ init_symbols_cache (cfg->cache, cfg);
pcfg = lua_newuserdata (L, sizeof (struct rspamd_config *));
rspamd_lua_setclass (L, "rspamd{config}", -1);
*pcfg = cfg;
@@ -136,6 +137,7 @@ lua_util_config_from_ucl (lua_State *L)
rspamd_init_cfg (cfg, FALSE);
cfg->lua_state = L;
cfg->rcl_obj = obj;
+ cfg->cache = rspamd_symbols_cache_new ();
top = rspamd_rcl_config_init ();
if (!rspamd_rcl_parse (top, cfg, cfg->cfg_pool, cfg->rcl_obj, &err)) {
@@ -145,7 +147,7 @@ lua_util_config_from_ucl (lua_State *L)
}
else {
rspamd_config_post_load (cfg);
- init_symbols_cache (cfg->cfg_pool, cfg->cache, cfg, NULL, TRUE);
+ init_symbols_cache (cfg->cache, cfg);
pcfg = lua_newuserdata (L, sizeof (struct rspamd_config *));
rspamd_lua_setclass (L, "rspamd{config}", -1);
*pcfg = cfg;