From: Vsevolod Stakhov Date: Thu, 18 Aug 2016 15:00:44 +0000 (+0100) Subject: [Feature] Pass authenticated bit to lua X-Git-Tag: 1.3.4~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=af18850cf0ab37405e586d655109b0dc84dcc8a1;p=rspamd.git [Feature] Pass authenticated bit to lua --- diff --git a/src/lua/lua_dns.c b/src/lua/lua_dns.c index cb834cf88..3593518cf 100644 --- a/src/lua/lua_dns.c +++ b/src/lua/lua_dns.c @@ -26,7 +26,7 @@ local function symbol_callback(task) local host = 'example.com' - local function dns_cb(resolver, to_resolve, results, err) + local function dns_cb(resolver, to_resolve, results, err, _, authenticated) if not results then rspamd_logger.infox('DNS resolving of %1 failed: %2', host, err) return @@ -198,7 +198,9 @@ lua_dns_callback (struct rdns_reply *reply, gpointer arg) lua_pushnil (cd->L); } - if (lua_pcall (cd->L, 5, 0, 0) != 0) { + lua_pushboolean (cd->L, reply->authenticated); + + if (lua_pcall (cd->L, 6, 0, 0) != 0) { msg_info ("call to dns callback failed: %s", lua_tostring (cd->L, -1)); lua_pop (cd->L, 1); }