From 6acbf5e15876c3fda98a79d38f7cfe4bea0663fe Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 23 Nov 2016 13:00:36 +0000 Subject: [Fix] Do not load tld file to speed up rspamadm --- src/libserver/cfg_file.h | 3 ++- src/libserver/cfg_utils.c | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/libserver') 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); -- cgit v1.2.3