aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-09-19 20:42:30 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-09-19 20:42:30 +0400
commit0a9d9f994e0e959c207676cbf01ca74c59ce1554 (patch)
tree80bb58ad210530d16a5a0b38bb95c970815bba99 /src/cfg_xml.c
parent91d183b8f4719ecc6b339cc3e8d9239bf7594e30 (diff)
downloadrspamd-0a9d9f994e0e959c207676cbf01ca74c59ce1554.tar.gz
rspamd-0a9d9f994e0e959c207676cbf01ca74c59ce1554.zip
* Add map_watch_interval configurable.
Support floating point values for time intervals.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 1f0c0aa78..e47ead1c8 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -306,6 +306,12 @@ static struct xml_parser_rule grammar[] = {
G_STRUCT_OFFSET (struct config_file, max_diff),
NULL
},
+ {
+ "map_watch_interval",
+ xml_handle_double,
+ G_STRUCT_OFFSET (struct config_file, map_timeout),
+ NULL
+ },
NULL_ATTR
},
NULL_DEF_ATTR
@@ -1604,12 +1610,23 @@ xml_handle_seconds (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GH
guint32 *dest;
dest = (guint32 *)G_STRUCT_MEMBER_P (dest_struct, offset);
- *dest = cfg_parse_time (data, TIME_SECONDS);
+ *dest = rint (cfg_parse_time (data, TIME_SECONDS));
return TRUE;
}
gboolean
+xml_handle_seconds_double (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset)
+{
+ gdouble *dest;
+
+ dest = (gdouble *)G_STRUCT_MEMBER_P (dest_struct, offset);
+ *dest = cfg_parse_time (data, TIME_SECONDS);
+
+ return TRUE;
+}
+
+gboolean
xml_handle_boolean (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset)
{
gboolean *dest;