Mercurial > prosody-hg
comparison plugins/mod_bosh.lua @ 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 | 61cf3e7d7f07 |
| children | 2acaf129e1c3 |
comparison
equal
deleted
inserted
replaced
| 3491:e8c06d20a18b | 3492:6d782b1fcc8a |
|---|---|
| 216 | 216 |
| 217 -- TODO: Sanity checks here (rid, to, known host, etc.) | 217 -- TODO: Sanity checks here (rid, to, known host, etc.) |
| 218 if not hosts[attr.to] then | 218 if not hosts[attr.to] then |
| 219 -- Unknown host | 219 -- Unknown host |
| 220 log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to)); | 220 log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to)); |
| 221 session_close_reply.body.attr.condition = "host-unknown"; | 221 local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", |
| 222 request:send(session_close_reply); | 222 ["xmlns:streams"] = xmlns_streams, condition = "host-unknown" }); |
| 223 request.notopen = nil | 223 request:send(tostring(close_reply)); |
| 224 return; | 224 return; |
| 225 end | 225 end |
| 226 | 226 |
| 227 -- New session | 227 -- New session |
| 228 sid = new_uuid(); | 228 sid = new_uuid(); |
