summaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-18 16:00:44 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-18 16:00:44 +0100
commitaf18850cf0ab37405e586d655109b0dc84dcc8a1 (patch)
tree8153f066c2e7a3f78fa08b1ce22e1c9f64ba3de6 /src/lua
parentbdf9d36628e94034fadb7e6e5c6f7927b735f40c (diff)
downloadrspamd-af18850cf0ab37405e586d655109b0dc84dcc8a1.tar.gz
rspamd-af18850cf0ab37405e586d655109b0dc84dcc8a1.zip
[Feature] Pass authenticated bit to lua
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_dns.c6
1 files changed, 4 insertions, 2 deletions
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);
}