mod_bosh: Fix traceback when initiating a BOSH session to an unknown host

Fri, 10 Sep 2010 17:56:24 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 10 Sep 2010 17:56:24 +0100
changeset 3492
6d782b1fcc8a
parent 3491
e8c06d20a18b
child 3493
f2b6115b531b

mod_bosh: Fix traceback when initiating a BOSH session to an unknown host

plugins/mod_bosh.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_bosh.lua	Thu Sep 09 20:10:28 2010 +0100
+++ b/plugins/mod_bosh.lua	Fri Sep 10 17:56:24 2010 +0100
@@ -218,9 +218,9 @@
 		if not hosts[attr.to] then
 			-- Unknown host
 			log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to));
-			session_close_reply.body.attr.condition = "host-unknown";
-			request:send(session_close_reply);
-			request.notopen = nil
+			local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
+				["xmlns:streams"] = xmlns_streams, condition = "host-unknown" });
+			request:send(tostring(close_reply));
 			return;
 		end
 		

mercurial