# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1528495765 -7200
# Node ID c72a6226ee31ffdee7b5a56c495ac6e51c2ee1e3
# Parent  e6ba0e5260b4fb768b41313a3df5971a62dd503a
mod_s2s: Fix DNS timeout setting for per-session resolvers (fixes #1167)

diff -r e6ba0e5260b4 -r c72a6226ee31 plugins/mod_s2s/s2sout.lib.lua
--- a/plugins/mod_s2s/s2sout.lib.lua	Sun Jun 03 00:40:42 2018 +0200
+++ b/plugins/mod_s2s/s2sout.lib.lua	Sat Jun 09 00:09:25 2018 +0200
@@ -30,7 +30,6 @@
 local has_ipv4, has_ipv6;
 
 local dns_timeout = module:get_option_number("dns_timeout", 15);
-dns.settimeout(dns_timeout);
 
 local s2sout = {};
 
@@ -50,6 +49,7 @@
 	host_session.version = 1;
 
 	host_session.resolver = adns.resolver();
+	host_session.resolver._resolver:settimeout(dns_timeout);
 
 	-- Kick the connection attempting machine into life
 	if not s2sout.attempt_connection(host_session) then