summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-26 18:24:26 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-26 18:24:26 +0400
commit0e88083420796af997f1af0396e4ea78ac235ba5 (patch)
treef46619cd9e156a69f2e82d5b8f5487bd92832076
parentbe47db1dd7a15f4c0f43b3230e245fdd525f840b (diff)
downloadrspamd-0e88083420796af997f1af0396e4ea78ac235ba5.tar.gz
rspamd-0e88083420796af997f1af0396e4ea78ac235ba5.zip
* Turn off debug_ip during reload if it was disabled by new config
-rw-r--r--src/logger.c7
-rw-r--r--src/lua/lua_common.c6
2 files changed, 7 insertions, 6 deletions
diff --git a/src/logger.c b/src/logger.c
index 55a7f0fe5..4b04a93f1 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -246,6 +246,9 @@ rspamd_set_logger (enum rspamd_log_type type, enum process_type ptype, struct co
/* Set up conditional logging */
if (cfg->debug_ip_map != NULL) {
/* Try to add it as map first of all */
+ if (rspamd_log->debug_ip) {
+ radix_tree_free (rspamd_log->debug_ip);
+ }
rspamd_log->debug_ip = radix_tree_create ();
if (!add_map (cfg->debug_ip_map, read_radix_list, fin_radix_list, (void **)&rspamd_log->debug_ip)) {
/* Try to parse it as list */
@@ -277,6 +280,10 @@ rspamd_set_logger (enum rspamd_log_type type, enum process_type ptype, struct co
g_strfreev (strvec);
}
}
+ else if (rspamd_log->debug_ip) {
+ radix_tree_free (rspamd_log->debug_ip);
+ rspamd_log->debug_ip = NULL;
+ }
}
int
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 36ef2a422..3bf81da55 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -209,7 +209,6 @@ void
init_lua_filters (struct config_file *cfg)
{
struct config_file **pcfg;
- gpointer *plogger;
GList *cur, *tmp;
struct script_module *module;
struct statfile *st;
@@ -230,11 +229,6 @@ init_lua_filters (struct config_file *cfg)
lua_setclass (L, "rspamd{config}", -1);
*pcfg = cfg;
lua_setglobal (L, "rspamd_config");
- /* Initialize logger */
- plogger = lua_newuserdata (L, sizeof (gpointer));
- lua_setclass (L, "rspamd{logger}", -1);
- *plogger = NULL;
- lua_setglobal (L, "rspamd_log");
/* do the call (1 arguments, 1 result) */
if (lua_pcall (L, 0, LUA_MULTRET, 0) != 0) {