diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-10 19:15:03 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-10 19:15:03 +0400 |
commit | 1fd435e5d4fc3c51fae8a1a184b347bdf6039d26 (patch) | |
tree | f17ee669ea0d5bfa497b3c952e8d7bed9885501a /src/cfg_utils.c | |
parent | 683b90f4c6c744557f7429ce6ff77c0f7d2175e1 (diff) | |
download | rspamd-1fd435e5d4fc3c51fae8a1a184b347bdf6039d26.tar.gz rspamd-1fd435e5d4fc3c51fae8a1a184b347bdf6039d26.zip |
* 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
Diffstat (limited to 'src/cfg_utils.c')
-rw-r--r-- | src/cfg_utils.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); |