# HG changeset patch # User Matthew Wild # Date 1579963122 0 # Node ID 3bfb20be844cf314f13c1080db89fb6230f5ac2f # Parent 0725b7b8dc1463290620820960df43cd0199f89c mod_s2s: Pass use_ipv4/use_ipv6 from config to service resolver diff -r 0725b7b8dc14 -r 3bfb20be844c plugins/mod_s2s/mod_s2s.lua --- a/plugins/mod_s2s/mod_s2s.lua Sat Jan 25 14:38:17 2020 +0000 +++ b/plugins/mod_s2s/mod_s2s.lua Sat Jan 25 14:38:42 2020 +0000 @@ -51,6 +51,12 @@ 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 @@ 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