From: Vsevolod Stakhov Date: Mon, 26 Jul 2010 14:24:26 +0000 (+0400) Subject: * Turn off debug_ip during reload if it was disabled by new config X-Git-Tag: 0.3.1~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0e88083420796af997f1af0396e4ea78ac235ba5;p=rspamd.git * Turn off debug_ip during reload if it was disabled by new config --- 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) {