diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-12-22 17:25:51 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-12-22 17:25:51 +0300 |
commit | fd34e65f68a612e097611d261616457ce2e91966 (patch) | |
tree | 62124eebf89feb2d9c95ef23c682ad6b15ba358e | |
parent | 58b4fd600f29fc3c7da691dfccfda3aeb3e9b9ef (diff) | |
download | rspamd-fd34e65f68a612e097611d261616457ce2e91966.tar.gz rspamd-fd34e65f68a612e097611d261616457ce2e91966.zip |
Init cache before loading config.
-rw-r--r-- | src/cfg_xml.c | 1 | ||||
-rw-r--r-- | src/main.c | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c index 70f3ebda8..389298e4a 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -1023,7 +1023,6 @@ handle_composite (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHas return FALSE; } g_hash_table_insert (cfg->composite_symbols, val, expr); - register_virtual_symbol (&cfg->cache, val, 1); return TRUE; } diff --git a/src/main.c b/src/main.c index 72a7b6eac..14a4988ee 100644 --- a/src/main.c +++ b/src/main.c @@ -829,6 +829,12 @@ main (gint argc, gchar **argv, gchar **env) register_classifier_opt ("winnow", "min_tokens"); register_classifier_opt ("winnow", "learn_threshold"); + /* Pre-init of cache */ + rspamd->cfg->cache = g_new0 (struct symbols_cache, 1); + rspamd->cfg->cache->static_pool = memory_pool_new (memory_pool_get_size ()); + rspamd->cfg->cache->cfg = rspamd->cfg; + + /* Load config */ if (! load_rspamd_config (rspamd->cfg, TRUE)) { exit (EXIT_FAILURE); } @@ -837,10 +843,6 @@ main (gint argc, gchar **argv, gchar **env) if (is_debug) { rspamd->cfg->log_level = G_LOG_LEVEL_DEBUG; } - /* Pre-init of cache */ - rspamd->cfg->cache = g_new0 (struct symbols_cache, 1); - rspamd->cfg->cache->static_pool = memory_pool_new (memory_pool_get_size ()); - rspamd->cfg->cache->cfg = rspamd->cfg; if (rspamd->cfg->config_test || dump_vars || dump_cache) { /* Init events to test modules */ |