# HG changeset patch # User Matthew Wild # Date 1250016521 -3600 # Node ID b31ea419dff56cb944176c2b0aa5cad8d3e6835a # Parent 33b1aee4b77f8e9e273611427952f6a7db4c74ca mod_bosh: Correct reply when closing sessions diff -r 33b1aee4b77f -r b31ea419dff5 plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Tue Aug 11 19:40:38 2009 +0100 +++ b/plugins/mod_bosh.lua Tue Aug 11 19:48:41 2009 +0100 @@ -31,6 +31,7 @@ local BOSH_DEFAULT_MAXPAUSE = tonumber(module:get_option("bosh_max_pause")) or 300; local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8" }; +local session_close_reply = { headers = default_headers, body = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate" }), attr = {} }; local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; local os_time = os.time; @@ -110,11 +111,9 @@ local function bosh_reset_stream(session) session.notopen = true; end -local session_close_reply = { headers = default_headers, body = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate" }), attr = {} }; local function bosh_close_stream(session, reason) (session.log or log)("info", "BOSH client disconnected"); session_close_reply.attr.condition = reason; - local session_close_reply = tostring(session_close_reply); for _, held_request in ipairs(session.requests) do held_request:send(session_close_reply); held_request:destroy();