From 9c549e66a047b61d71e087617f67932781158f6b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 21 Jul 2015 14:54:12 +0100 Subject: Fix some issues with lua_dns. --- src/lua/lua_dns.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3