diff options
author | Kim Alvefur <zash@zash.se> | 2014-05-22 22:45:58 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-05-22 22:45:58 +0200 |
commit | c9cd737d873287c12c833bd24dc8a20f640f56a1 (patch) | |
tree | b216062dc80196a7676355551327a46716f9b0b4 /plugins | |
parent | 45d1171aad2ce4116c04ed75feec535c1dd9bbf8 (diff) | |
download | prosody-c9cd737d873287c12c833bd24dc8a20f640f56a1.tar.gz prosody-c9cd737d873287c12c833bd24dc8a20f640f56a1.zip |
mod_s2s: Decide on log function once
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 5 |
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 |