aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/s2sout.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-14 18:16:23 +0200
committerKim Alvefur <zash@zash.se>2018-06-14 18:16:23 +0200
commit259d4a6180ff2b3447dba0636e859d81a7c6c27b (patch)
treef43aa6c3b963dc6cf0c95ed62d4790ff24fdc86e /plugins/mod_s2s/s2sout.lib.lua
parent239ebf1d77c7bba39ab2c2ec29d4773c87c2b809 (diff)
downloadprosody-259d4a6180ff2b3447dba0636e859d81a7c6c27b.tar.gz
prosody-259d4a6180ff2b3447dba0636e859d81a7c6c27b.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.lua7
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