From c9cd737d873287c12c833bd24dc8a20f640f56a1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 22 May 2014 22:45:58 +0200 Subject: mod_s2s: Decide on log function once --- plugins/mod_s2s/mod_s2s.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/mod_s2s/mod_s2s.lua') 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 -- cgit v1.2.3