# HG changeset patch # User Matthew Wild # Date 1525036544 -3600 # Node ID d5ff0982d3e633fbf3e9bc9e4c3a5e5e8dd9872e # Parent 81d305bbe7bc2ea83e4a67a1e783053ac795d0e1 mod_bosh: Fix for 7be8f649d97d to skip error handling and allow other modules to handle the request diff -r 81d305bbe7bc -r d5ff0982d3e6 plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Sat Sep 09 14:45:23 2017 +0100 +++ b/plugins/mod_bosh.lua Sun Apr 29 22:15:44 2018 +0100 @@ -191,8 +191,10 @@ 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 @@ 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));