diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-23 13:00:36 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-23 13:00:36 +0000 |
commit | 6acbf5e15876c3fda98a79d38f7cfe4bea0663fe (patch) | |
tree | 3ecbe2fafb9a9753fe79943da34a199bef5cf3be | |
parent | 01ed3a335605e01c31f2e3b4203f8eed96258c13 (diff) | |
download | rspamd-6acbf5e15876c3fda98a79d38f7cfe4bea0663fe.tar.gz rspamd-6acbf5e15876c3fda98a79d38f7cfe4bea0663fe.zip |
[Fix] Do not load tld file to speed up rspamadm
-rw-r--r-- | src/libserver/cfg_file.h | 3 | ||||
-rw-r--r-- | src/libserver/cfg_utils.c | 7 | ||||
-rw-r--r-- | src/rspamadm/rspamadm.c | 3 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index 1f31d372e..ea75622f8 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -478,7 +478,8 @@ enum rspamd_post_load_options { RSPAMD_CONFIG_INIT_URL = 1 << 0, RSPAMD_CONFIG_INIT_LIBS = 1 << 1, RSPAMD_CONFIG_INIT_SYMCACHE = 1 << 2, - RSPAMD_CONFIG_INIT_VALIDATE = 1 << 3 + RSPAMD_CONFIG_INIT_VALIDATE = 1 << 3, + RSPAMD_CONFIG_INIT_NO_TLD = 1 << 4 }; #define RSPAMD_CONFIG_LOAD_ALL (RSPAMD_CONFIG_INIT_URL|RSPAMD_CONFIG_INIT_LIBS|RSPAMD_CONFIG_INIT_SYMCACHE|RSPAMD_CONFIG_INIT_VALIDATE) diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 3ec553592..46b574ac8 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -729,7 +729,12 @@ rspamd_config_post_load (struct rspamd_config *cfg, } } - rspamd_url_init (cfg->tld_file); + if (opts & RSPAMD_CONFIG_INIT_NO_TLD) { + rspamd_url_init (NULL); + } + else { + rspamd_url_init (cfg->tld_file); + } } init_dynamic_config (cfg); diff --git a/src/rspamadm/rspamadm.c b/src/rspamadm/rspamadm.c index 6e5541b32..de1e53143 100644 --- a/src/rspamadm/rspamadm.c +++ b/src/rspamadm/rspamadm.c @@ -285,7 +285,8 @@ main (gint argc, gchar **argv, gchar **env) (void) rspamd_log_open (rspamd_main->logger); g_log_set_default_handler (rspamd_glib_log_function, rspamd_main->logger); g_set_printerr_handler (rspamd_glib_printerr_function); - rspamd_config_post_load (cfg, RSPAMD_CONFIG_INIT_LIBS|RSPAMD_CONFIG_INIT_URL); + rspamd_config_post_load (cfg, + RSPAMD_CONFIG_INIT_LIBS|RSPAMD_CONFIG_INIT_URL|RSPAMD_CONFIG_INIT_NO_TLD); /* Setup logger */ if (verbose) { |