diff options
author | Kim Alvefur <zash@zash.se> | 2018-06-14 18:16:23 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-06-14 18:16:23 +0200 |
commit | 3237e9eb9d60644a756880173d6f8fd615bc478d (patch) | |
tree | f43aa6c3b963dc6cf0c95ed62d4790ff24fdc86e /plugins/mod_s2s/s2sout.lib.lua | |
parent | ee03f52d2044b38e82a1ba61922354663a5cb805 (diff) | |
download | prosody-3237e9eb9d60644a756880173d6f8fd615bc478d.tar.gz prosody-3237e9eb9d60644a756880173d6f8fd615bc478d.zip |
mod_s2s: Use session logger to ease debugging
Diffstat (limited to 'plugins/mod_s2s/s2sout.lib.lua')
-rw-r--r-- | plugins/mod_s2s/s2sout.lib.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_s2s/s2sout.lib.lua b/plugins/mod_s2s/s2sout.lib.lua index 2fbcae26..1c0cd5ed 100644 --- a/plugins/mod_s2s/s2sout.lib.lua +++ b/plugins/mod_s2s/s2sout.lib.lua @@ -46,6 +46,8 @@ local function compare_srv_priorities(a,b) end function s2sout.initiate_connection(host_session) + local log = host_session.log or log; + initialize_filters(host_session); host_session.version = 1; @@ -84,6 +86,7 @@ end function s2sout.attempt_connection(host_session, err) local to_host = host_session.to_host; local connect_host, connect_port = to_host and idna_to_ascii(to_host), 5269; + local log = host_session.log or log; if not connect_host then return false; @@ -166,6 +169,7 @@ end function s2sout.try_connect(host_session, connect_host, connect_port, err) host_session.connecting = true; + local log = host_session.log or log; if not err then local IPs = {}; @@ -266,7 +270,8 @@ function s2sout.try_connect(host_session, connect_host, connect_port, err) end function s2sout.make_connect(host_session, connect_host, connect_port) - (host_session.log or log)("debug", "Beginning new connection attempt to %s ([%s]:%d)", host_session.to_host, connect_host.addr, connect_port); + local log = host_session.log or log; + log("debug", "Beginning new connection attempt to %s ([%s]:%d)", host_session.to_host, connect_host.addr, connect_port); -- Reset secure flag in case this is another -- connection attempt after a failed STARTTLS |