diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-10-02 17:35:42 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-10-02 17:35:42 +0400 |
commit | 80d2b194b1e8ce902a2feac5389bc4de8d5732a5 (patch) | |
tree | e3211a619650b9e8af9967e194f668cea25e53fc /src/cfg_xml.c | |
parent | 6205f36ee17d54e9e43d495ba929ed7708c98027 (diff) | |
download | rspamd-80d2b194b1e8ce902a2feac5389bc4de8d5732a5.tar.gz rspamd-80d2b194b1e8ce902a2feac5389bc4de8d5732a5.zip |
Allow multiply statfiles with a same label.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r-- | src/cfg_xml.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c index bcec06c1d..60bfbf96f 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -1907,6 +1907,7 @@ rspamd_xml_end_element (GMarkupParseContext *context, const gchar *element_name, gpointer tptr; struct wrk_cbdata wcd; struct xml_subparser *subparser; + GList *labels; if (g_ascii_strcasecmp (element_name, "if") == 0) { tptr = g_queue_pop_head (ud->if_stack); @@ -1962,11 +1963,11 @@ rspamd_xml_end_element (GMarkupParseContext *context, const gchar *element_name, ud->cfg->statfiles = g_list_prepend (ud->cfg->statfiles, st); g_hash_table_insert (ud->cfg->classifiers_symbols, st->symbol, ccf); if (st->label) { - if (g_hash_table_lookup (ccf->labels, st->label)) { - msg_warn ("duplicate statfile label %s with symbol %s, ignoring", st->label, st->symbol); + if ((labels = g_hash_table_lookup (ccf->labels, st->label))) { + labels = g_list_append (labels, st); } else { - g_hash_table_insert (ccf->labels, st->label, st); + g_hash_table_insert (ccf->labels, st->label, g_list_prepend (NULL, st)); } } ud->section_pointer = ccf; |