134 |
134 |
135 -- TODO: Sanity checks here (rid, to, known host, etc.) |
135 -- TODO: Sanity checks here (rid, to, known host, etc.) |
136 if not hosts[attr.to] then |
136 if not hosts[attr.to] then |
137 -- Unknown host |
137 -- Unknown host |
138 log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to)); |
138 log("debug", "BOSH client tried to connect to unknown host: %s", tostring(attr.to)); |
139 session_close_reply.attr.condition = "host-unknown"; |
139 session_close_reply.body.attr.condition = "host-unknown"; |
140 request:send{ headers = default_headers, body = tostring(session_close_reply) }; |
140 request:send(session_close_reply); |
141 request.notopen = nil |
141 request.notopen = nil |
142 return; |
142 return; |
143 end |
143 end |
144 |
144 |
145 -- New session |
145 -- New session |