aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2013-01-05 20:29:26 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2013-01-05 20:29:26 +0400
commit393a7c39ecc9224faa7c11afc32c8e74f54ea3c5 (patch)
tree4082f7e479ada5b1002ca1592ad8577f745de0f1 /src/cfg_xml.c
parent6de87da477a194e566e3c672d5d41da743d6641d (diff)
downloadrspamd-393a7c39ecc9224faa7c11afc32c8e74f54ea3c5.tar.gz
rspamd-393a7c39ecc9224faa7c11afc32c8e74f54ea3c5.zip
Add webui handler for rspamd (skeleton).
Fix url detector. Add group option for modules options. Some fixes in controller and rrd code.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 277172f2b..88650c990 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -324,6 +324,12 @@ static struct xml_parser_rule grammar[] = {
G_STRUCT_OFFSET (struct config_file, mlock_statfile_pool),
NULL
},
+ {
+ "rrd",
+ xml_handle_string,
+ G_STRUCT_OFFSET (struct config_file, rrd_file),
+ NULL
+ },
NULL_ATTR
},
NULL_DEF_ATTR
@@ -1109,11 +1115,18 @@ handle_module_opt (struct config_file *cfg, struct rspamd_xml_userdata *ctx, con
name = memory_pool_strdup (cfg->cfg_pool, tag);
}
- /* Check for lua */
- if (attrs != NULL && (val = g_hash_table_lookup (attrs, "lua")) != NULL) {
- if (g_ascii_strcasecmp (val, "yes") == 0) {
+ cur = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct module_opt));
+ /* Check for options */
+ if (attrs != NULL) {
+ if ((val = g_hash_table_lookup (attrs, "lua")) != NULL && g_ascii_strcasecmp (val, "yes") == 0) {
is_lua = TRUE;
}
+ if ((val = g_hash_table_lookup (attrs, "description")) != NULL) {
+ cur->description = memory_pool_strdup (cfg->cfg_pool, val);
+ }
+ if ((val = g_hash_table_lookup (attrs, "group")) != NULL) {
+ cur->group = memory_pool_strdup (cfg->cfg_pool, val);
+ }
}
/*
* XXX: in fact we cannot check for lua modules and need to do it in post-config procedure
@@ -1121,7 +1134,6 @@ handle_module_opt (struct config_file *cfg, struct rspamd_xml_userdata *ctx, con
*/
/* Insert option */
- cur = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct module_opt));
cur->param = (char *)name;
cur->value = data;
cur->is_lua = is_lua;