diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-02-24 16:23:46 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-02-24 16:23:46 +0000 |
commit | 07151a029c71a7d868003f5ab3c76d4e9812eb2d (patch) | |
tree | de23e9acf420ce5ae271837be41e71f46350c79c /plugins/s2s/s2sout.lib.lua | |
parent | f397b79717e372748b156e4874d0b0a483a2c134 (diff) | |
parent | 39a677bc8af8e6e97e896afb72e986ae7cbb9a7e (diff) | |
download | prosody-07151a029c71a7d868003f5ab3c76d4e9812eb2d.tar.gz prosody-07151a029c71a7d868003f5ab3c76d4e9812eb2d.zip |
Merge Zash with Florob and Maranda
Diffstat (limited to 'plugins/s2s/s2sout.lib.lua')
-rw-r--r-- | plugins/s2s/s2sout.lib.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/s2s/s2sout.lib.lua b/plugins/s2s/s2sout.lib.lua index 64786862..808c7e74 100644 --- a/plugins/s2s/s2sout.lib.lua +++ b/plugins/s2s/s2sout.lib.lua @@ -15,18 +15,18 @@ local add_task = require "util.timer".add_task; local new_ip = require "util.ip".new_ip; local rfc3484_dest = require "util.rfc3484".destination; local socket = require "socket"; -local t_insert, t_sort = table.insert, table.sort; +local t_insert, t_sort, ipairs = table.insert, table.sort, ipairs; local st = require "util.stanza"; -local s2s_destroy_session = require "core.s2smanager".destroy_session; local s2s_new_outgoing = require "core.s2smanager".new_outgoing; +local s2s_destroy_session = require "core.s2smanager".destroy_session; + +local cfg_sources = config.get("*", "core", "s2s_interfaces") or socket.local_addresses and socket.local_addresses() or { "*" }; local s2sout = {}; local s2s_listener; -local cfg_sources = config.get("*", "core", "s2s_interfaces") or {"*"}; -local sources function s2sout.set_listener(listener) s2s_listener = listener; @@ -156,6 +156,7 @@ function s2sout.try_next_ip(host_session) end function s2sout.try_connect(host_session, connect_host, connect_port, err) + local sources; host_session.connecting = true; if not err then @@ -165,7 +166,7 @@ function s2sout.try_connect(host_session, connect_host, connect_port, err) local has_other = false; if not sources then - sources = {}; + sources = {}; for i, source in ipairs(cfg_sources) do if source == "*" then sources[i] = new_ip("0.0.0.0", "IPv4"); |