aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-27 09:21:10 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-27 09:21:10 +0000
commit1d5c1d7b7f12803e12230260cd517d980bf30ca1 (patch)
treefd83fff8bbd6e2c5525c03acf1ce48f70d9ae715 /src/lua
parent04101f59f5cd8c08d86bbf2e5d7563f3c1a43887 (diff)
downloadrspamd-1d5c1d7b7f12803e12230260cd517d980bf30ca1.tar.gz
rspamd-1d5c1d7b7f12803e12230260cd517d980bf30ca1.zip
[Minor] Core: Pass server name when doing DNS request
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_dns_resolver.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lua/lua_dns_resolver.c b/src/lua/lua_dns_resolver.c
index ffc4cd738..d108744e1 100644
--- a/src/lua/lua_dns_resolver.c
+++ b/src/lua/lua_dns_resolver.c
@@ -172,6 +172,7 @@ lua_dns_resolver_callback (struct rdns_reply *reply, gpointer arg)
* 4 - error | nil
* 5 - user_str
* 6 - reply->authenticated
+ * 7 - server
*/
if (reply->code != RDNS_RC_NOERROR) {
lua_pushnil (L);
@@ -186,12 +187,21 @@ lua_dns_resolver_callback (struct rdns_reply *reply, gpointer arg)
lua_pushboolean (L, reply->authenticated);
+ const gchar *servname = rdns_request_get_server (reply->request);
+
+ if (servname) {
+ lua_pushstring (L, servname);
+ }
+ else {
+ lua_pushnil (L);
+ }
+
if (cd->item) {
/* We also need to restore the item in case there are some chains */
rspamd_symcache_set_cur_item (cd->task, cd->item);
}
- if (lua_pcall (L, 6, 0, err_idx) != 0) {
+ if (lua_pcall (L, 7, 0, err_idx) != 0) {
tb = lua_touserdata (L, -1);
if (tb) {