Software /
code /
prosody
Comparison
core/s2smanager.lua @ 852:3c2d99ba1dc2
core.s2smanager: Remove some old commented code, break a long line in 2
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 02 Mar 2009 13:52:08 +0000 |
parent | 760:90ce865eebd8 |
child | 896:2c0b9e3c11c3 |
comparison
equal
deleted
inserted
replaced
851:b48c7ed3f7f8 | 852:3c2d99ba1dc2 |
---|---|
204 | 204 |
205 -- TODO: #29: SASL/TLS on s2s streams | 205 -- TODO: #29: SASL/TLS on s2s streams |
206 session.version = 0; --tonumber(attr.version) or 0; | 206 session.version = 0; --tonumber(attr.version) or 0; |
207 | 207 |
208 if session.version >= 1.0 and not (attr.to and attr.from) then | 208 if session.version >= 1.0 and not (attr.to and attr.from) then |
209 --print("to: "..tostring(attr.to).." from: "..tostring(attr.from)); | |
210 log("warn", (session.to_host or "(unknown)").." failed to specify 'to' or 'from' hostname as per RFC"); | 209 log("warn", (session.to_host or "(unknown)").." failed to specify 'to' or 'from' hostname as per RFC"); |
211 end | 210 end |
212 | 211 |
213 if session.direction == "incoming" then | 212 if session.direction == "incoming" then |
214 -- Send a reply stream header | 213 -- Send a reply stream header |
215 | |
216 --for k,v in pairs(attr) do print("", tostring(k), ":::", tostring(v)); end | |
217 | |
218 session.to_host = attr.to; | 214 session.to_host = attr.to; |
219 session.from_host = attr.from; | 215 session.from_host = attr.from; |
220 | 216 |
221 session.streamid = uuid_gen(); | 217 session.streamid = uuid_gen(); |
222 (session.log or log)("debug", "incoming s2s received <stream:stream>"); | 218 (session.log or log)("debug", "incoming s2s received <stream:stream>"); |
223 send("<?xml version='1.0'?>"); | 219 send("<?xml version='1.0'?>"); |
224 send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.to_host }):top_tag()); | 220 send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', |
221 ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.to_host }):top_tag()); | |
225 if session.to_host and not hosts[session.to_host] then | 222 if session.to_host and not hosts[session.to_host] then |
226 -- Attempting to connect to a host we don't serve | 223 -- Attempting to connect to a host we don't serve |
227 session:close({ condition = "host-unknown"; text = "This host does not serve "..session.to_host }); | 224 session:close({ condition = "host-unknown"; text = "This host does not serve "..session.to_host }); |
228 return; | 225 return; |
229 end | 226 end |