aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-14 22:20:50 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-14 22:20:50 +0400
commit56b591bcb2c91ab8af7def656f115e2e794a2b8a (patch)
tree47e1100e382e1b5fe104b6f0a357902f1e3c2d34 /src/cfg_xml.c
parent32e13585b6bd05acb30b7747f6ce22b94079bbb0 (diff)
downloadrspamd-56b591bcb2c91ab8af7def656f115e2e794a2b8a.tar.gz
rspamd-56b591bcb2c91ab8af7def656f115e2e794a2b8a.zip
* Allow to use other composites inside a composite's expression
Fix for cmake 2.6.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 6c21fa14d..ad542265d 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -1276,6 +1276,7 @@ handle_composite (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHas
{
gchar *val;
struct expression *expr;
+ struct rspamd_composite *composite;
if (attrs == NULL || (val = g_hash_table_lookup (attrs, "name")) == NULL) {
msg_err ("'name' attribute is required for tag 'composite'");
@@ -1286,7 +1287,10 @@ handle_composite (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHas
msg_err ("cannot parse composite expression: %s", data);
return FALSE;
}
- g_hash_table_insert (cfg->composite_symbols, val, expr);
+ composite = memory_pool_alloc (cfg->cfg_pool, sizeof (struct rspamd_composite));
+ composite->expr = expr;
+ composite->id = g_hash_table_size (cfg->composite_symbols) + 1;
+ g_hash_table_insert (cfg->composite_symbols, val, composite);
register_virtual_symbol (&cfg->cache, val, 1);
return TRUE;