aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-05-13 17:30:24 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-05-13 17:30:24 +0400
commit5c523994ca5320fcfbab749b0e882dc70f53fb7f (patch)
treec66702395d7d952ffa25abc32edc92713ec6f252 /src/cfg_xml.c
parent7ae3070c49ac09f1cdc75e72f2e5ef50dc82ff81 (diff)
downloadrspamd-5c523994ca5320fcfbab749b0e882dc70f53fb7f.tar.gz
rspamd-5c523994ca5320fcfbab749b0e882dc70f53fb7f.zip
* Dump grow factor to XML
* Insert classifiers parsed from xml config to config object * Fix reinitializing of lua filters
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 1fe9a9fd5..df55277ad 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -1310,6 +1310,15 @@ rspamd_xml_end_element (GMarkupParseContext *context, const gchar *element_name,
break;
case XML_READ_CLASSIFIER:
CHECK_TAG ("classifier", FALSE);
+ if (res) {
+ ccf = ud->section_pointer;
+ if (ccf->statfiles == NULL) {
+ *error = g_error_new (xml_error_quark (), XML_PARAM_MISSING, "classifier cannot contains no statfiles");
+ ud->state = XML_ERROR;
+ return;
+ }
+ ud->cfg->classifiers = g_list_prepend (ud->cfg->classifiers, ccf);
+ }
break;
case XML_READ_STATFILE:
CHECK_TAG ("statfile", FALSE);
@@ -1619,6 +1628,9 @@ xml_dump_factors (struct config_file *cfg, FILE *f)
/* Iterate through variables */
g_hash_table_foreach (cfg->factors, xml_factors_callback, (gpointer)f);
+ /* Grow factor */
+ fprintf (f, " <grow_factor>%.2f</grow_factor>" EOL, cfg->grow_factor);
+
/* Print footer comment */
fprintf (f, "</factors>" EOL "<!-- End of factors section -->" EOL EOL);