aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-20 11:22:49 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-20 11:22:49 +0100
commit91f754b32428c567c645f99fe580c2be7770fce9 (patch)
tree805a2b01fbe4bbee3e3c1e45f40469a19b97ed96 /src/lua
parentc9e03dc0fd1bddb460d1c51c40876e70a6c7970e (diff)
downloadrspamd-91f754b32428c567c645f99fe580c2be7770fce9.tar.gz
rspamd-91f754b32428c567c645f99fe580c2be7770fce9.zip
Fix processing tasks from lua.
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index aa0b24d68..f72e77d87 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -84,6 +84,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);
pcfg = lua_newuserdata (L, sizeof (struct rspamd_config *));
rspamd_lua_setclass (L, "rspamd{config}", -1);
*pcfg = cfg;
@@ -117,6 +118,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);
pcfg = lua_newuserdata (L, sizeof (struct rspamd_config *));
rspamd_lua_setclass (L, "rspamd{config}", -1);
*pcfg = cfg;
@@ -132,6 +134,7 @@ lua_util_task_fin (struct rspamd_task *task, void *ud)
ucl_object_t **target = ud;
*target = rspamd_protocol_write_ucl (task, NULL);
+ rdns_resolver_release (task->resolver->r);
return TRUE;
}
@@ -150,6 +153,7 @@ lua_util_process_message (lua_State *L)
if (cfg != NULL && message != NULL) {
base = event_init ();
+ rspamd_init_filters (cfg, FALSE);
task = rspamd_task_new (NULL);
task->cfg = cfg;
task->ev_base = base;
@@ -173,6 +177,7 @@ lua_util_process_message (lua_State *L)
else {
ucl_object_push_lua (L, rspamd_protocol_write_ucl (task, NULL),
true);
+ rdns_resolver_release (task->resolver->r);
rspamd_task_free_hard (task);
}
}