aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-06-05 21:39:56 +0100
committerMatthew Wild <mwild1@gmail.com>2013-06-05 21:39:56 +0100
commitb174c0dba2d13e37a17ccb71a124063e2873215d (patch)
treef2ca6eac446e1fc77cce9ba3b607b6331419fdc5 /plugins
parent885b4a7e2a8565d7d9fa9a1fd97723dc4af0d129 (diff)
downloadprosody-b174c0dba2d13e37a17ccb71a124063e2873215d.tar.gz
prosody-b174c0dba2d13e37a17ccb71a124063e2873215d.zip
mod_bosh: Return errors when appropriate (invalid XML, missing sid)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index 3c5e18f0..90522031 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -123,7 +123,10 @@ function handle_POST(event)
-- In particular, the streamopened() stream callback is where
-- much of the session logic happens, because it's where we first
-- get to see the 'sid' of this request.
- stream:feed(body);
+ if not stream:feed(body) then
+ module:log("warn", "Error parsing BOSH payload")
+ return 400;
+ end
-- Stanzas (if any) in the request have now been processed, and
-- we take care of the high-level BOSH logic here, including
@@ -174,6 +177,8 @@ function handle_POST(event)
return true; -- Inform http server we shall reply later
end
end
+ module:log("warn", "Unable to associate request with a session (incomplete request?)");
+ return 400;
end