aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-13 14:50:37 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-13 14:50:37 +0100
commit28afb066ad6c30fdd251f83fbcf8c94429049663 (patch)
tree8f8a1dca445fce2481266a3dc60c6689c711cc41 /src/libserver/cfg_utils.c
parent3c1fc14d55038b41da5b56fb92153e1a5901e08e (diff)
downloadrspamd-28afb066ad6c30fdd251f83fbcf8c94429049663.tar.gz
rspamd-28afb066ad6c30fdd251f83fbcf8c94429049663.zip
Fix some issues with new symbols structure.
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r--src/libserver/cfg_utils.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 69b25a872..fcf5b4fd9 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -189,7 +189,6 @@ rspamd_config_free (struct rspamd_config *cfg)
g_hash_table_unref (cfg->cfg_params);
g_hash_table_destroy (cfg->metrics_symbols);
g_hash_table_destroy (cfg->classifiers_symbols);
- g_hash_table_unref (cfg->symbols_groups);
if (cfg->checksum) {
g_free (cfg->checksum);
@@ -1005,7 +1004,7 @@ rspamd_config_add_metric_symbol (struct rspamd_config *cfg,
group = "ungrouped";
}
- sym_group = g_hash_table_lookup (cfg->symbols_groups, group);
+ sym_group = g_hash_table_lookup (metric->groups, group);
if (sym_group == NULL) {
/* Create new group */
sym_group =
@@ -1013,12 +1012,11 @@ rspamd_config_add_metric_symbol (struct rspamd_config *cfg,
sizeof (struct rspamd_symbols_group));
sym_group->name = rspamd_mempool_strdup (cfg->cfg_pool, group);
sym_group->symbols = NULL;
- g_hash_table_insert (cfg->symbols_groups, sym_group->name, sym_group);
+ g_hash_table_insert (metric->groups, sym_group->name, sym_group);
}
sym_def->gr = sym_group;
-
- LL_PREPEND (sym_group->symbols, sym_def);
+ g_hash_table_insert (sym_group->symbols, sym_def->name, sym_def);
return TRUE;
}
@@ -1085,7 +1083,7 @@ rspamd_config_is_module_enabled (struct rspamd_config *cfg,
}
/* Now we check symbols group */
- gr = g_hash_table_lookup (cfg->symbols_groups, module_name);
+ gr = g_hash_table_lookup (metric->groups, module_name);
if (gr) {
if (gr->disabled) {