diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-04-10 20:28:59 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-04-10 20:28:59 +0100 |
commit | 850ca60e4f5d85c4e5dafe5ce43dcf23deeec3cc (patch) | |
tree | fab6dd1ba6d9a005561831be4eb41d0afdac8e12 /plugins | |
parent | 9f963fda9cc3c769ff439687b9b63f9a4315c8fa (diff) | |
download | prosody-850ca60e4f5d85c4e5dafe5ce43dcf23deeec3cc.tar.gz prosody-850ca60e4f5d85c4e5dafe5ce43dcf23deeec3cc.zip |
mod_bosh: Improve logging - parse errors will now log through the session logger if possible
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_bosh.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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 |