aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-10-01 22:08:36 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-10-01 22:08:36 +0400
commit6205f36ee17d54e9e43d495ba929ed7708c98027 (patch)
tree6af53ce62a1e0e749cef789a77cfe3e6f0652722 /src/cfg_xml.c
parentcdb0282eb749fc0cb274575b01c9ca988a5f5db1 (diff)
downloadrspamd-6205f36ee17d54e9e43d495ba929ed7708c98027.tar.gz
rspamd-6205f36ee17d54e9e43d495ba929ed7708c98027.zip
* 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.
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;