diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-21 14:54:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-21 15:04:02 +0100 |
commit | 9c549e66a047b61d71e087617f67932781158f6b (patch) | |
tree | 5ffce61bf7226956781c0304a78e87e03f8db34b /src/lua | |
parent | 243144b79facadc69ad4fdcb9e616e9662fdb9e0 (diff) | |
download | rspamd-9c549e66a047b61d71e087617f67932781158f6b.tar.gz rspamd-9c549e66a047b61d71e087617f67932781158f6b.zip |
Fix some issues with lua_dns.
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_dns.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lua/lua_dns.c b/src/lua/lua_dns.c index de7a0c2e8..a471662e2 100644 --- a/src/lua/lua_dns.c +++ b/src/lua/lua_dns.c @@ -277,7 +277,7 @@ lua_dns_resolver_resolve_common (lua_State *L, lua_gettable (L, -2); if (to_resolve == NULL || lua_type (L, -1) != LUA_TFUNCTION) { - lua_pop (L, 1); + lua_pop (L, 2); msg_err ("DNS request has bad params"); lua_pushboolean (L, FALSE); return 1; @@ -315,6 +315,13 @@ lua_dns_resolver_resolve_common (lua_State *L, lua_pop (L, 1); } + lua_pushstring (L, "option"); + lua_gettable (L, -2); + if (lua_type (L, -1) == LUA_TSTRING) { + user_str = luaL_checkstring (L, -1); + } + lua_pop (L, 1); + lua_pop (L, 1); } |