aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-21 13:04:02 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-21 13:04:02 +0000
commit99963a5250604a03d009ec2c2edf14d3355d55e7 (patch)
tree07c7099b6cd16abe08a026ca22c3156d3ea4d680 /src/lua/lua_config.c
parent40f282236aa5b3952803e66a731b98897bba73c8 (diff)
downloadrspamd-99963a5250604a03d009ec2c2edf14d3355d55e7.tar.gz
rspamd-99963a5250604a03d009ec2c2edf14d3355d55e7.zip
[Fix] Fix parsing of lua table arguments
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 654035dab..a519be2ae 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1204,8 +1204,8 @@ lua_config_register_symbol (lua_State * L)
*description = NULL, *group = NULL;
double weight = 0, score = NAN;
gboolean one_shot = FALSE;
- gint ret = -1, cbref = -1, type, flags = 0, nshots = 0;
- gint64 parent = 0, priority = 0;
+ gint ret = -1, cbref = -1, type, flags = 0;
+ gint64 parent = 0, priority = 0, nshots = 0;
GError *err = NULL;
if (cfg) {
@@ -1488,7 +1488,7 @@ lua_config_set_metric_symbol (lua_State * L)
GError *err = NULL;
gdouble priority = 0.0;
guint flags = 0;
- gint nshots = 0;
+ gint64 nshots = 0;
if (cfg) {
@@ -1758,7 +1758,7 @@ lua_config_newindex (lua_State *L)
{
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name;
- gint id, nshots = 0;
+ gint id, nshots;
gboolean optional = FALSE;
name = luaL_checkstring (L, 2);
@@ -1874,6 +1874,7 @@ lua_config_newindex (lua_State *L)
* insert default value if applicable
*/
if (g_hash_table_lookup (cfg->metrics_symbols, name) == NULL) {
+ nshots = cfg->default_max_shots;
lua_pushstring (L, "score");
lua_gettable (L, -2);