Software /
code /
prosody
Comparison
plugins/mod_s2s/s2sout.lib.lua @ 8899:c72a6226ee31
mod_s2s: Fix DNS timeout setting for per-session resolvers (fixes #1167)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 09 Jun 2018 00:09:25 +0200 |
parent | 8267:42fad8465537 |
child | 8902:ac21f13798ae |
comparison
equal
deleted
inserted
replaced
8898:e6ba0e5260b4 | 8899:c72a6226ee31 |
---|---|
28 | 28 |
29 local sources = {}; | 29 local sources = {}; |
30 local has_ipv4, has_ipv6; | 30 local has_ipv4, has_ipv6; |
31 | 31 |
32 local dns_timeout = module:get_option_number("dns_timeout", 15); | 32 local dns_timeout = module:get_option_number("dns_timeout", 15); |
33 dns.settimeout(dns_timeout); | |
34 | 33 |
35 local s2sout = {}; | 34 local s2sout = {}; |
36 | 35 |
37 local s2s_listener; | 36 local s2s_listener; |
38 | 37 |
48 function s2sout.initiate_connection(host_session) | 47 function s2sout.initiate_connection(host_session) |
49 initialize_filters(host_session); | 48 initialize_filters(host_session); |
50 host_session.version = 1; | 49 host_session.version = 1; |
51 | 50 |
52 host_session.resolver = adns.resolver(); | 51 host_session.resolver = adns.resolver(); |
52 host_session.resolver._resolver:settimeout(dns_timeout); | |
53 | 53 |
54 -- Kick the connection attempting machine into life | 54 -- Kick the connection attempting machine into life |
55 if not s2sout.attempt_connection(host_session) then | 55 if not s2sout.attempt_connection(host_session) then |
56 -- Intentionally not returning here, the | 56 -- Intentionally not returning here, the |
57 -- session is needed, connected or not | 57 -- session is needed, connected or not |