aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index e47ead1c8..bcec06c1d 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -484,6 +484,12 @@ static struct xml_parser_rule grammar[] = {
NULL
},
{
+ "label",
+ xml_handle_string,
+ G_STRUCT_OFFSET (struct statfile, label),
+ NULL
+ },
+ {
"size",
xml_handle_size,
G_STRUCT_OFFSET (struct statfile, size),
@@ -1955,6 +1961,14 @@ rspamd_xml_end_element (GMarkupParseContext *context, const gchar *element_name,
ccf->statfiles = g_list_prepend (ccf->statfiles, st);
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);
+ }
+ else {
+ g_hash_table_insert (ccf->labels, st->label, st);
+ }
+ }
ud->section_pointer = ccf;
ud->parent_pointer = NULL;
ud->state = XML_READ_CLASSIFIER;