]> source.dussan.org Git - rspamd.git/commitdiff
Init cache before loading config.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 22 Dec 2010 14:25:51 +0000 (17:25 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 22 Dec 2010 14:25:51 +0000 (17:25 +0300)
src/cfg_xml.c
src/main.c

index 70f3ebda890682ca824a42dfb8b6dcefebe824c0..389298e4a87ad1771ff9918d7860f05767ada45a 100644 (file)
@@ -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;
 }
index 72a7b6eac32d3e02b9990d888e1bd603505b1870..14a4988eec9c0c8a741a0d15af4de9e08464d061 100644 (file)
@@ -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 */