Comparison

core/s2smanager.lua @ 938:663f75dd7b42

Fixed: Some nil access bugs
author Waqas Hussain <waqas20@gmail.com>
date Mon, 30 Mar 2009 05:26:10 +0500
parent 931:4514ed5ee943
child 959:e3db909065f2
comparison
equal deleted inserted replaced
937:40ccaacb2000 938:663f75dd7b42
210 log("warn", (session.to_host or "(unknown)").." failed to specify 'to' or 'from' hostname as per RFC"); 210 log("warn", (session.to_host or "(unknown)").." failed to specify 'to' or 'from' hostname as per RFC");
211 end 211 end
212 212
213 if session.direction == "incoming" then 213 if session.direction == "incoming" then
214 -- Send a reply stream header 214 -- Send a reply stream header
215 session.to_host = nameprep(attr.to); 215 session.to_host = attr.to and nameprep(attr.to);
216 session.from_host = nameprep(attr.from); 216 session.from_host = attr.from and nameprep(attr.from);
217 217
218 session.streamid = uuid_gen(); 218 session.streamid = uuid_gen();
219 (session.log or log)("debug", "incoming s2s received <stream:stream>"); 219 (session.log or log)("debug", "incoming s2s received <stream:stream>");
220 send("<?xml version='1.0'?>"); 220 send("<?xml version='1.0'?>");
221 send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', 221 send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback',