summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-19 15:37:20 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-19 16:29:21 +0100
commitd671707efb0803b291f1095cfdaef8f5d7bbe457 (patch)
tree7ea5f3516b86b9124cfb162b2129fd26b15af572
parent0583ca87da55b9d83d9cbd8b3c42ff0237f8d457 (diff)
downloadrspamd-d671707efb0803b291f1095cfdaef8f5d7bbe457.tar.gz
rspamd-d671707efb0803b291f1095cfdaef8f5d7bbe457.zip
Fix reloading of modules.
-rw-r--r--src/libserver/cfg_utils.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 5194d5266..da444cba2 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -854,15 +854,17 @@ rspamd_init_filters (struct rspamd_config *cfg, bool reconfig)
struct module_ctx *mod_ctx;
/* Init all compiled modules */
- for (pmod = modules; *pmod != NULL; pmod ++) {
- mod = *pmod;
- mod_ctx = g_slice_alloc0 (sizeof (struct module_ctx));
-
- if (mod->module_init_func (cfg, &mod_ctx) == 0) {
- g_hash_table_insert (cfg->c_modules,
- (gpointer) mod->name,
- mod_ctx);
- mod_ctx->mod = mod;
+ if (!reconfig) {
+ for (pmod = modules; *pmod != NULL; pmod ++) {
+ mod = *pmod;
+ mod_ctx = g_slice_alloc0 (sizeof (struct module_ctx));
+
+ if (mod->module_init_func (cfg, &mod_ctx) == 0) {
+ g_hash_table_insert (cfg->c_modules,
+ (gpointer) mod->name,
+ mod_ctx);
+ mod_ctx->mod = mod;
+ }
}
}