# HG changeset patch # User Kim Alvefur # Date 1400791558 -7200 # Node ID 6167f8bc5a6b61541b8d653be0f18377a0e78210 # Parent 02d366be7c2fc9237d3e72786657d8cb0d0cd5d6 mod_s2s: Decide on log function once diff -r 02d366be7c2f -r 6167f8bc5a6b plugins/mod_s2s/mod_s2s.lua --- a/plugins/mod_s2s/mod_s2s.lua Mon May 12 01:16:17 2014 +0200 +++ b/plugins/mod_s2s/mod_s2s.lua Thu May 22 22:45:58 2014 +0200 @@ -529,6 +529,7 @@ -- 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 @@ 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