diff options
-rw-r--r-- | src/cfg_xml.c | 12 | ||||
-rw-r--r-- | src/main.c | 1 |
2 files changed, 13 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); diff --git a/src/main.c b/src/main.c index 883d93ff5..33cc130d3 100644 --- a/src/main.c +++ b/src/main.c @@ -288,6 +288,7 @@ reread_config (struct rspamd_main *rspamd) } l = g_list_next (l); } + init_lua_filters (rspamd->cfg); init_metrics_cache (rspamd->cfg); msg_info ("config rereaded successfully"); } |