From 6205f36ee17d54e9e43d495ba929ed7708c98027 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 1 Oct 2012 22:08:36 +0400 Subject: * Add dynamic configuration dumping. * Add labels support to the statfiles (would be used for meta-classification) * Rewrite exim spam.c patch to work with both rspamd and SA by using 'variant=rspamd' option in spam_server line. --- src/cfg_xml.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/cfg_xml.c') 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 @@ -483,6 +483,12 @@ static struct xml_parser_rule grammar[] = { G_STRUCT_OFFSET (struct statfile, path), NULL }, + { + "label", + xml_handle_string, + G_STRUCT_OFFSET (struct statfile, label), + NULL + }, { "size", xml_handle_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; -- cgit v1.2.3