Changeset

3492:6d782b1fcc8a

mod_bosh: Fix traceback when initiating a BOSH session to an unknown host
author Matthew Wild <mwild1@gmail.com>
date Fri, 10 Sep 2010 17:56:24 +0100
parents 3491:e8c06d20a18b
children 3493:f2b6115b531b
files plugins/mod_bosh.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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