aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r--core/s2smanager.lua12
1 files changed, 5 insertions, 7 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 684bb94e..ccdf4932 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -9,8 +9,7 @@
local hosts = prosody.hosts;
-local tostring, pairs, setmetatable
- = tostring, pairs, setmetatable;
+local pairs, setmetatable = pairs, setmetatable;
local logger_init = require "util.logger".init;
local sessionlib = require "util.session";
@@ -75,8 +74,8 @@ local function retire_session(session, reason)
session.destruction_reason = reason;
- function session.send(data) log("debug", "Discarding data sent to resting session: %s", tostring(data)); end
- function session.data(data) log("debug", "Discarding data received from resting session: %s", tostring(data)); end
+ function session.send(data) log("debug", "Discarding data sent to resting session: %s", data); end
+ function session.data(data) log("debug", "Discarding data received from resting session: %s", data); end
session.thread = { run = function (_, data) return session.data(data) end };
session.sends2s = session.send;
return setmetatable(session, resting_session);
@@ -84,9 +83,8 @@ end
local function destroy_session(session, reason)
if session.destroyed then return; end
- (session.log or log)("debug", "Destroying "..tostring(session.direction)
- .." session "..tostring(session.from_host).."->"..tostring(session.to_host)
- ..(reason and (": "..reason) or ""));
+ local log = session.log or log;
+ log("debug", "Destroying %s session %s->%s%s%s", session.direction, session.from_host, session.to_host, reason and ": " or "", reason or "");
if session.direction == "outgoing" then
hosts[session.from_host].s2sout[session.to_host] = nil;