aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-21 14:54:12 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-21 15:04:02 +0100
commit9c549e66a047b61d71e087617f67932781158f6b (patch)
tree5ffce61bf7226956781c0304a78e87e03f8db34b /src/lua
parent243144b79facadc69ad4fdcb9e616e9662fdb9e0 (diff)
downloadrspamd-9c549e66a047b61d71e087617f67932781158f6b.tar.gz
rspamd-9c549e66a047b61d71e087617f67932781158f6b.zip
Fix some issues with lua_dns.
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_dns.c9
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);
}