summaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-15 17:59:12 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-15 17:59:12 +0300
commitbeab78097de6a53430bb16310e41b93d74546cb9 (patch)
treebe45e11a8cbf7ed0b0640bdd3e0a2ffa290474e0 /src/cfg_xml.c
parentb3928c8e33fe8fe7b5d496c6beeb8f66dcdfa104 (diff)
downloadrspamd-beab78097de6a53430bb16310e41b93d74546cb9.tar.gz
rspamd-beab78097de6a53430bb16310e41b93d74546cb9.zip
* Add ability to add descriptions for symbols
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index a85b77777..aa91bfda0 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -805,7 +805,7 @@ handle_metric_action (struct config_file *cfg, struct rspamd_xml_userdata *ctx,
gboolean
handle_metric_symbol (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset)
{
- gchar *strval, *err;
+ gchar *strval, *err, *desc;
double *value;
GList *metric_list;
struct metric *metric = ctx->section_pointer;
@@ -824,6 +824,13 @@ handle_metric_symbol (struct config_file *cfg, struct rspamd_xml_userdata *ctx,
}
}
+ if (attrs != NULL) {
+ desc = g_hash_table_lookup (attrs, "description");
+ if (desc) {
+ g_hash_table_insert (metric->descriptions, data, memory_pool_strdup (cfg->cfg_pool, desc));
+ }
+ }
+
g_hash_table_insert (metric->symbols, data, value);
if ((metric_list = g_hash_table_lookup (cfg->metrics_symbols, data)) == NULL) {