aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-05-22 22:45:58 +0200
committerKim Alvefur <zash@zash.se>2014-05-22 22:45:58 +0200
commit6eef30829cec33b4def141a013b9deb400bd84cb (patch)
treeb216062dc80196a7676355551327a46716f9b0b4 /plugins
parenta88f746203415474f1fb6cd2c9d4f5b6875f6b17 (diff)
downloadprosody-6eef30829cec33b4def141a013b9deb400bd84cb.tar.gz
prosody-6eef30829cec33b4def141a013b9deb400bd84cb.zip
mod_s2s: Decide on log function once
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 263f24c0..d35fc489 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -529,6 +529,7 @@ end
-- Session initialization logic shared by incoming and outgoing
local function initialize_session(session)
local stream = new_xmpp_stream(session, stream_callbacks);
+ local log = session.log or log;
session.stream = stream;
session.notopen = true;
@@ -546,8 +547,8 @@ local function initialize_session(session)
if data then
local ok, err = stream:feed(data);
if ok then return; end
- (session.log or log)("warn", "Received invalid XML: %s", data);
- (session.log or log)("warn", "Problem was: %s", err);
+ log("warn", "Received invalid XML: %s", data);
+ log("warn", "Problem was: %s", err);
session:close("not-well-formed");
end
end