Comparison

core/s2smanager.lua @ 333:8d15b073fdbe

session:disconnect() -> session:close() for consistency with other Lua APIs
author Matthew Wild <mwild1@gmail.com>
date Tue, 18 Nov 2008 19:44:54 +0000
parent 331:830fd67f9378
child 337:4a1dd1c2c219
comparison
equal deleted inserted replaced
332:51e130b5c8de 333:8d15b073fdbe
137 print(session, session.from_host, "incoming s2s stream opened"); 137 print(session, session.from_host, "incoming s2s stream opened");
138 send("<?xml version='1.0'?>"); 138 send("<?xml version='1.0'?>");
139 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()); 139 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());
140 if session.to_host and not hosts[session.to_host] then 140 if session.to_host and not hosts[session.to_host] then
141 -- Attempting to connect to a host we don't serve 141 -- Attempting to connect to a host we don't serve
142 session:disconnect("host-unknown"); 142 session:close("host-unknown");
143 return; 143 return;
144 end 144 end
145 elseif session.direction == "outgoing" then 145 elseif session.direction == "outgoing" then
146 -- If we are just using the connection for verifying dialback keys, we won't try and auth it 146 -- If we are just using the connection for verifying dialback keys, we won't try and auth it
147 if not attr.id then error("stream response did not give us a streamid!!!"); end 147 if not attr.id then error("stream response did not give us a streamid!!!"); end
228 228
229 if session.direction == "outgoing" then 229 if session.direction == "outgoing" then
230 hosts[session.from_host].s2sout[session.to_host] = nil; 230 hosts[session.from_host].s2sout[session.to_host] = nil;
231 end 231 end
232 232
233 session.conn = nil;
234 session.disconnect = nil;
235 for k in pairs(session) do 233 for k in pairs(session) do
236 if k ~= "trace" then 234 if k ~= "trace" then
237 session[k] = nil; 235 session[k] = nil;
238 end 236 end
239 end 237 end