Changeset

10613:74d66b1be989

mod_s2s: Pass use_ipv4/ipv6 from config to connector config
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Jan 2020 13:49:33 +0000
parents 10612:44ef46e1a951
children 10614:431511e190bc
files plugins/mod_s2s/mod_s2s.lua
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua	Fri Jan 24 13:48:49 2020 +0000
+++ b/plugins/mod_s2s/mod_s2s.lua	Fri Jan 24 13:49:33 2020 +0000
@@ -27,7 +27,7 @@
 local uuid_gen = require "util.uuid".generate;
 local fire_global_event = prosody.events.fire_event;
 local runner = require "util.async".runner;
-local connect = require "net.connect".connect;
+local new_connector = require "net.connect".new_connector;
 local service = require "net.resolvers.service";
 local errors = require "util.error";
 local set = require "util.set";
@@ -51,6 +51,11 @@
 
 local log = module._log;
 
+local connect = new_connector({
+	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;