281 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", |
281 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", |
282 ["xmlns:stream"] = xmlns_streams, condition = "improper-addressing" }); |
282 ["xmlns:stream"] = xmlns_streams, condition = "improper-addressing" }); |
283 response:send(tostring(close_reply)); |
283 response:send(tostring(close_reply)); |
284 return; |
284 return; |
285 elseif to_host ~= module.host then |
285 elseif to_host ~= module.host then |
286 -- Unknown host |
286 -- Could be meant for a different instance of the module |
287 log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to)); |
287 -- if multiple instances are loaded with the same URL then this can happen |
288 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", |
288 return; --> 404 |
289 ["xmlns:stream"] = xmlns_streams, condition = "host-unknown" }); |
|
290 response:send(tostring(close_reply)); |
|
291 return; |
|
292 end |
289 end |
293 if not rid or (not wait and attr.wait or wait < 0 or wait % 1 ~= 0) then |
290 if not rid or (not wait and attr.wait or wait < 0 or wait % 1 ~= 0) then |
294 log("debug", "BOSH client sent invalid rid or wait attributes: rid=%s, wait=%s", tostring(attr.rid), tostring(attr.wait)); |
291 log("debug", "BOSH client sent invalid rid or wait attributes: rid=%s, wait=%s", tostring(attr.rid), tostring(attr.wait)); |
295 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", |
292 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", |
296 ["xmlns:stream"] = xmlns_streams, condition = "bad-request" }); |
293 ["xmlns:stream"] = xmlns_streams, condition = "bad-request" }); |