Comparison

plugins/mod_bosh.lua @ 4379:e4d88f4a780c

mod_bosh: s/xmlns:streams/xmlns:stream/ - fixes #265 (thanks Tim)
author Matthew Wild <mwild1@gmail.com>
date Thu, 15 Sep 2011 17:38:24 +0100
parent 4332:8154bc28e520
child 4436:aa79b3767f98
child 4526:cdab466551bd
comparison
equal deleted inserted replaced
4378:5e1f4af11626 4379:e4d88f4a780c
179 179
180 local function bosh_close_stream(session, reason) 180 local function bosh_close_stream(session, reason)
181 (session.log or log)("info", "BOSH client disconnected"); 181 (session.log or log)("info", "BOSH client disconnected");
182 182
183 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", 183 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
184 ["xmlns:streams"] = xmlns_streams }); 184 ["xmlns:stream"] = xmlns_streams });
185 185
186 186
187 if reason then 187 if reason then
188 close_reply.attr.condition = "remote-stream-error"; 188 close_reply.attr.condition = "remote-stream-error";
189 if type(reason) == "string" then -- assume stream error 189 if type(reason) == "string" then -- assume stream error
226 -- TODO: Sanity checks here (rid, to, known host, etc.) 226 -- TODO: Sanity checks here (rid, to, known host, etc.)
227 if not hosts[attr.to] then 227 if not hosts[attr.to] then
228 -- Unknown host 228 -- Unknown host
229 log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to)); 229 log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to));
230 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", 230 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
231 ["xmlns:streams"] = xmlns_streams, condition = "host-unknown" }); 231 ["xmlns:stream"] = xmlns_streams, condition = "host-unknown" });
232 request:send(tostring(close_reply)); 232 request:send(tostring(close_reply));
233 return; 233 return;
234 end 234 end
235 235
236 -- New session 236 -- New session