]> source.dussan.org Git - rspamd.git/commitdiff
* Dump grow factor to XML
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 13 May 2010 13:30:24 +0000 (17:30 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 13 May 2010 13:30:24 +0000 (17:30 +0400)
* Insert classifiers parsed from xml config to config object
* Fix reinitializing of lua filters

src/cfg_xml.c
src/main.c

index 1fe9a9fd56877006dd933204cfb0cbd9da19e6ad..df55277ad45252c84f83ee97ef07645637e28f05 100644 (file)
@@ -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);
 
index 883d93ff5d4ffd01cad9bd36b500266ab4bf17d5..33cc130d33253c30aa0c98bf6969476c96be1617 100644 (file)
@@ -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");
                }