From 1fd435e5d4fc3c51fae8a1a184b347bdf6039d26 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 10 May 2011 19:15:03 +0400 Subject: * Rework build process: - add librspamdserver - link this library to all daemons and utils of rspamd - use subdirectories more often * Rework global variables logic - move them to the main process * Fix logging to handle utf-8 correctly * Add statshow utility and make it working * Move printf functions to separate source file --- src/cfg_utils.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/cfg_utils.c') diff --git a/src/cfg_utils.c b/src/cfg_utils.c index 9acb442b5..99a4bc3d9 100644 --- a/src/cfg_utils.c +++ b/src/cfg_utils.c @@ -31,9 +31,7 @@ #include "settings.h" #include "classifiers/classifiers.h" #include "cfg_xml.h" -#ifdef WITH_LUA #include "lua/lua_common.h" -#endif #define DEFAULT_SCORE 10.0 @@ -183,6 +181,10 @@ init_defaults (struct config_file *cfg) cfg->classifiers_symbols = g_hash_table_new (g_str_hash, g_str_equal); cfg->cfg_params = g_hash_table_new (g_str_hash, g_str_equal); cfg->metrics_symbols = g_hash_table_new (g_str_hash, g_str_equal); + + cfg->log_level = G_LOG_LEVEL_WARNING; + cfg->log_extended = TRUE; + init_settings (cfg); } @@ -528,9 +530,9 @@ parse_filters_str (struct config_file *cfg, const gchar *str) while (*p) { cur = NULL; /* Search modules from known C modules */ - for (i = 0; i < MODULES_NUM; i++) { + for (i = 0; i < cfg->modules_num; i++) { g_strstrip (*p); - if (strcasecmp (modules[i].name, *p) == 0) { + if (modules[i].name != NULL && g_ascii_strcasecmp (modules[i].name, *p) == 0) { cur = memory_pool_alloc (cfg->cfg_pool, sizeof (struct filter)); cur->type = C_FILTER; msg_debug ("found C filter %s", *p); -- cgit v1.2.3