From: Kim Alvefur Date: Tue, 19 Apr 2016 15:10:42 +0000 (+0200) Subject: Merge 0.10->trunk X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=05120c2431c0341a1d8426d5305206cd40f51815;p=prosody.git Merge 0.10->trunk --- 05120c2431c0341a1d8426d5305206cd40f51815 diff --cc plugins/mod_bosh.lua index 47f0b3b4,d317e4b9..6acdc23c --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@@ -22,7 -21,7 +22,6 @@@ local initialize_filters = require "uti local math_min = math.min; local xpcall, tostring, type = xpcall, tostring, type; local traceback = debug.traceback; - local runner = require"util.async".runner; -local nameprep = require "util.encodings".stringprep.nameprep; local xmlns_streams = "http://etherx.jabber.org/streams"; local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams"; @@@ -200,16 -183,15 +189,20 @@@ function handle_POST(event else return true; -- Inform http server we shall reply later end + elseif response.finished then + return; -- A response has been sent already end module:log("warn", "Unable to associate request with a session (incomplete request?)"); - return 400; + local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", + ["xmlns:stream"] = xmlns_streams, condition = "item-not-found" }); + return tostring(close_reply) .. "\n"; end +function after_bosh_wait(now, request, session) + if request.conn then + session.send(""); + end +end local function bosh_reset_stream(session) session.notopen = true; end