aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_bosh.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-04-10 20:28:59 +0100
committerMatthew Wild <mwild1@gmail.com>2018-04-10 20:28:59 +0100
commitf40a467d0c7a8907a45a3d557dcf231be1b2ac44 (patch)
treefab6dd1ba6d9a005561831be4eb41d0afdac8e12 /plugins/mod_bosh.lua
parentf537f1572c3ba43d9b63f8d545b849c24312462b (diff)
downloadprosody-f40a467d0c7a8907a45a3d557dcf231be1b2ac44.tar.gz
prosody-f40a467d0c7a8907a45a3d557dcf231be1b2ac44.zip
mod_bosh: Improve logging - parse errors will now log through the session logger if possible
Diffstat (limited to 'plugins/mod_bosh.lua')
-rw-r--r--plugins/mod_bosh.lua3
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