aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-01-25 14:38:42 +0000
committerMatthew Wild <mwild1@gmail.com>2020-01-25 14:38:42 +0000
commit165901fe8023f03c5e4b8083a6f588c306775d78 (patch)
tree1605ae912ed9ed6be3abb8d881ca35965ead9d71 /plugins/mod_s2s/mod_s2s.lua
parentd1fbb9197f3546153fc52428115a725eb1399a4c (diff)
downloadprosody-165901fe8023f03c5e4b8083a6f588c306775d78.tar.gz
prosody-165901fe8023f03c5e4b8083a6f588c306775d78.zip
mod_s2s: Pass use_ipv4/use_ipv6 from config to service resolver
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 00d8f5d9..4c509ba9 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -51,6 +51,12 @@ local listener = {};
local log = module._log;
+local s2s_service_options = {
+ default_port = 5269;
+ use_ipv4 = module:get_option_boolean("use_ipv4", true);
+ use_ipv6 = module:get_option_boolean("use_ipv6", true);
+};
+
module:hook("stats-update", function ()
local count = 0;
local ipv6 = 0;
@@ -165,7 +171,7 @@ function route_to_new_session(event)
host_session.bounce_sendq = bounce_sendq;
host_session.sendq = { {tostring(stanza), stanza.attr.type ~= "error" and stanza.attr.type ~= "result" and st.reply(stanza)} };
log("debug", "stanza [%s] queued until connection complete", stanza.name);
- connect(service.new(to_host, "xmpp-server", "tcp", { default_port = 5269 }), listener, nil, { session = host_session });
+ connect(service.new(to_host, "xmpp-server", "tcp", s2s_service_options), listener, nil, { session = host_session });
return true;
end