diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-14 03:14:09 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-14 03:14:09 +0300 |
commit | 3c2638e27f6a693318ec9d787885d20c28c41d36 (patch) | |
tree | 6dc377e186770998bbec76e63358ca8083c189a8 /src/cfg_xml.c | |
parent | d479b7c8ed1ce247d7c8beebe8870e24a151b357 (diff) | |
download | rspamd-3c2638e27f6a693318ec9d787885d20c28c41d36.tar.gz rspamd-3c2638e27f6a693318ec9d787885d20c28c41d36.zip |
* Add ability to setup metric's weights from lua
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r-- | src/cfg_xml.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c index b4eaee045..a85b77777 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -893,8 +893,13 @@ handle_lua (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable /* Assign global table to set up attributes */ lua_newtable (L); lua_setglobal (L, "config"); - /* Now config table can be used for configuring rspamd */ } + lua_getglobal (L, "metrics"); + if (lua_isnil (L, -1)) { + lua_newtable (L); + lua_setglobal (L, "metrics"); + } + /* Now config tables can be used for configuring rspamd */ /* First check "src" attribute */ if (attrs != NULL && (val = g_hash_table_lookup (attrs, "src")) != NULL) { /* Chdir */ |