aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-04-29 22:15:44 +0100
committerMatthew Wild <mwild1@gmail.com>2018-04-29 22:15:44 +0100
commitee0ca565fe4ff41c43cc9cd2264be2ba8077303f (patch)
tree7d5d7fcc5fa70133b64853b677bc90c62f04af0b /plugins
parent6e642dd99ce0c51cac44f5221efcc0cc310d0135 (diff)
downloadprosody-ee0ca565fe4ff41c43cc9cd2264be2ba8077303f.tar.gz
prosody-ee0ca565fe4ff41c43cc9cd2264be2ba8077303f.zip
mod_bosh: Fix for 7be8f649d97d to skip error handling and allow other modules to handle the request
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index c662fa5c..68922ebd 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -191,8 +191,10 @@ function handle_POST(event)
return true; -- Inform http server we shall reply later
end
- elseif response.finished then
- return; -- A response has been sent already
+ elseif response.finished or context.ignore_request then
+ -- A response has been sent already, or we're ignoring this request
+ -- (e.g. so a different instance of the module can handle it)
+ return;
end
module:log("warn", "Unable to associate request with a session (incomplete request?)");
local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
@@ -269,7 +271,8 @@ function stream_callbacks.streamopened(context, attr)
elseif to_host ~= module.host then
-- Could be meant for a different instance of the module
-- if multiple instances are loaded with the same URL then this can happen
- return; --> 404
+ context.ignore_request = true;
+ return;
end
if not rid or (not wait and attr.wait or wait < 0 or wait % 1 ~= 0) then
log("debug", "BOSH client sent invalid rid or wait attributes: rid=%s, wait=%s", tostring(attr.rid), tostring(attr.wait));