summaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-25 16:58:11 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-25 16:58:11 +0400
commit34ae83f0151a3fd31f4c045968defa39a2c40985 (patch)
tree3bb121336c76d16e3e5257c12a7905af0e04b70f /src/cfg_xml.c
parent4a8c30c78940a9153de23dc4d031273649e93cce (diff)
downloadrspamd-34ae83f0151a3fd31f4c045968defa39a2c40985.tar.gz
rspamd-34ae83f0151a3fd31f4c045968defa39a2c40985.zip
* Add rspamd_log variable to lua plugins to access logging functions
* Each part in rspamd task now can have parent part * Check for parts distance only for multipart/alternative subparts * Do not check attachements even if they are text (but attached as file) * Do not die if write (2) returned ENOSPACE while doing logging, turn on throttling mode instead (1 write try in a second) * Add ability to turn on debug for specific symbols * Add ability to configure dns timeouts and dns retransmits in config file
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 534bfa961..0f9bff97e 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -151,6 +151,18 @@ static struct xml_parser_rule grammar[] = {
G_STRUCT_OFFSET (struct config_file, cache_filename),
NULL
},
+ {
+ "dns_timeout",
+ xml_handle_seconds,
+ G_STRUCT_OFFSET (struct config_file, dns_timeout),
+ NULL
+ },
+ {
+ "dns_retransmits",
+ xml_handle_uint32,
+ G_STRUCT_OFFSET (struct config_file, dns_retransmits),
+ NULL
+ },
NULL_ATTR
},
NULL_ATTR
@@ -186,6 +198,12 @@ static struct xml_parser_rule grammar[] = {
G_STRUCT_OFFSET (struct config_file, debug_ip_map),
NULL
},
+ {
+ "debug_symbols",
+ xml_handle_string_list,
+ G_STRUCT_OFFSET (struct config_file, debug_symbols),
+ NULL
+ },
NULL_ATTR
},
NULL_ATTR
@@ -1144,6 +1162,29 @@ xml_handle_string (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHa
return TRUE;
}
+gboolean
+xml_handle_string_list (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, int offset)
+{
+ GList **dest;
+ gchar **tokens, **cur;
+
+ dest = (GList **)G_STRUCT_MEMBER_P (dest_struct, offset);
+ *dest = NULL;
+
+ tokens = g_strsplit (data, ";,", 0);
+ if (!tokens || !tokens[0]) {
+ return FALSE;
+ }
+ memory_pool_add_destructor (cfg->cfg_pool, (pool_destruct_func)g_strfreev, tokens);
+ cur = tokens;
+ while (*cur) {
+ *dest = g_list_prepend (*dest, *cur);
+ cur ++;
+ }
+
+ return TRUE;
+}
+
gboolean
xml_handle_size (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, int offset)
@@ -1159,9 +1200,9 @@ xml_handle_size (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHash
gboolean
xml_handle_seconds (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, int offset)
{
- time_t *dest;
+ guint32 *dest;
- dest = (time_t *)G_STRUCT_MEMBER_P (dest_struct, offset);
+ dest = (guint32 *)G_STRUCT_MEMBER_P (dest_struct, offset);
*dest = parse_seconds (data);
return TRUE;