From 850ca60e4f5d85c4e5dafe5ce43dcf23deeec3cc Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 10 Apr 2018 20:28:59 +0100 Subject: mod_bosh: Improve logging - parse errors will now log through the session logger if possible --- plugins/mod_bosh.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 1418b145..039e8763 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -463,8 +463,8 @@ function stream_callbacks.streamclosed(context) end function stream_callbacks.error(context, error) - log("debug", "Error parsing BOSH request payload; %s", error); if not context.sid then + log("debug", "Error parsing BOSH request payload; %s", error); local response = context.response; local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", ["xmlns:stream"] = xmlns_streams, condition = "bad-request" }); @@ -473,6 +473,7 @@ function stream_callbacks.error(context, error) end local session = sessions[context.sid]; + (session and session.log or log)("warn", "Error parsing BOSH request payload; %s", error); if error == "stream-error" then -- Remote stream error, we close normally session:close(); else -- cgit v1.2.3