summaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-23 13:00:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-23 13:00:36 +0000
commit6acbf5e15876c3fda98a79d38f7cfe4bea0663fe (patch)
tree3ecbe2fafb9a9753fe79943da34a199bef5cf3be /src/libserver
parent01ed3a335605e01c31f2e3b4203f8eed96258c13 (diff)
downloadrspamd-6acbf5e15876c3fda98a79d38f7cfe4bea0663fe.tar.gz
rspamd-6acbf5e15876c3fda98a79d38f7cfe4bea0663fe.zip
[Fix] Do not load tld file to speed up rspamadm
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/cfg_file.h3
-rw-r--r--src/libserver/cfg_utils.c7
2 files changed, 8 insertions, 2 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);