# HG changeset patch # User Matthew Wild # Date 1523388539 -3600 # Node ID 0f4a4d8ac3ddb76728e543f41e8d955201b657a3 # Parent 81929cfe7f86f381362129f26cfc8e403240df7e mod_bosh: Improve logging - parse errors will now log through the session logger if possible diff -r 81929cfe7f86 -r 0f4a4d8ac3dd plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Tue Apr 10 20:25:12 2018 +0100 +++ b/plugins/mod_bosh.lua Tue Apr 10 20:28:59 2018 +0100 @@ -463,8 +463,8 @@ 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 @@ 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