summaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-04-06 19:26:25 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-04-06 19:26:25 +0400
commit1cb8543e85476db7e01f9a30cedc509d26b78b9b (patch)
tree2560d92a859b651089443dc71360a30811f61c2d /src/cfg_xml.c
parent87fd3373b9e8f0b3356ded2949e09b00b251599c (diff)
downloadrspamd-1cb8543e85476db7e01f9a30cedc509d26b78b9b.tar.gz
rspamd-1cb8543e85476db7e01f9a30cedc509d26b78b9b.zip
* Add ability to specify dns nameservers in a config
* Add ability to select between round-robin and master-slave algorithms for dns servers
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 43b2e0441..b84d556b7 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -238,6 +238,12 @@ static struct xml_parser_rule grammar[] = {
NULL
},
{
+ "dns_nameserver",
+ options_handle_nameserver,
+ 0,
+ NULL
+ },
+ {
"raw_mode",
xml_handle_boolean,
G_STRUCT_OFFSET (struct config_file, raw_mode),
@@ -776,6 +782,13 @@ handle_log_level (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHas
return TRUE;
}
+gboolean
+options_handle_nameserver (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset)
+{
+ cfg->nameservers = g_list_prepend (cfg->nameservers, memory_pool_strdup (cfg->cfg_pool, data));
+ return TRUE;
+}
+
/* Worker section */
gboolean
worker_handle_param (struct config_file *cfg, struct rspamd_xml_userdata *ctx, const gchar *tag, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset)