aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-01 11:08:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-01 11:08:43 +0100
commit6bd388ae930900bef74532f810c4411650761868 (patch)
treebb164cd166ae1a43c2c7214d6961f0acda622ec8 /src/lua/lua_config.c
parent083e6ac5ce374e1e9759c7998dd04b9525333eb4 (diff)
downloadrspamd-6bd388ae930900bef74532f810c4411650761868.tar.gz
rspamd-6bd388ae930900bef74532f810c4411650761868.zip
[Minor] Add flags for rspamd_lua_parse_table_arguments
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index c171c483a..18baf8551 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1892,6 +1892,7 @@ lua_config_register_symbol (lua_State * L)
if (cfg) {
if (!rspamd_lua_parse_table_arguments (L, 2, &err,
+ RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
"name=S;weight=N;callback=F;flags=S;type=S;priority=I;parent=D;"
"score=D;description=S;group=S;one_shot=B;nshots=I;"
"allowed_ids=S;forbidden_ids=S",
@@ -2227,6 +2228,7 @@ lua_config_set_metric_symbol (lua_State * L)
if (lua_type (L, 2) == LUA_TTABLE) {
if (!rspamd_lua_parse_table_arguments (L, 2, &err,
+ RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
"*name=S;score=N;description=S;"
"group=S;one_shot=B;one_param=B;priority=N;flags=S;"
"nshots=I",
@@ -2376,6 +2378,7 @@ lua_config_set_metric_action (lua_State * L)
if (lua_type (L, 2) == LUA_TTABLE) {
if (!rspamd_lua_parse_table_arguments (L, 2, &err,
+ RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
"*action=S;score=N;"
"priority=N",
&name, &threshold,
@@ -2881,6 +2884,7 @@ lua_config_register_regexp (lua_State *L)
*/
if (cfg != NULL) {
if (!rspamd_lua_parse_table_arguments (L, 2, &err,
+ RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
"*re=U{regexp};*type=S;header=S;pcre_only=B",
&re, &type_str, &header_str, &pcre_only)) {
msg_err_config ("cannot get parameters list: %e", err);
@@ -2947,6 +2951,7 @@ lua_config_replace_regexp (lua_State *L)
if (cfg != NULL) {
if (!rspamd_lua_parse_table_arguments (L, 2, &err,
+ RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
"*old_re=U{regexp};*new_re=U{regexp}",
&old_re, &new_re)) {
msg_err_config ("cannot get parameters list: %e", err);
@@ -3686,6 +3691,7 @@ lua_config_add_doc (lua_State *L)
if (cfg && option && doc_string) {
if (lua_type (L, 5) == LUA_TTABLE) {
if (!rspamd_lua_parse_table_arguments (L, 5, &err,
+ RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
"type=S;default=S;required=B",
&type_str, &default_value, &required)) {
msg_err_config ("cannot get parameters list: %e", err);