Comparison

plugins/mod_s2s/mod_s2s.lua @ 5389:d147a4227a72

mod_s2s: Prevent traceback when replying to incoming connection to a host we don't serve
author Kim Alvefur <zash@zash.se>
date Tue, 26 Mar 2013 09:25:20 +0100
parent 5387:1130887e0d41
child 5390:b3c8757ee4f4
comparison
equal deleted inserted replaced
5388:f833d2188c16 5389:d147a4227a72
484 ["xml:lang"] = 'en', 484 ["xml:lang"] = 'en',
485 id = session.streamid, 485 id = session.streamid,
486 from = from, to = to, 486 from = from, to = to,
487 } 487 }
488 local local_host = session.direction == "outgoing" and from or to; 488 local local_host = session.direction == "outgoing" and from or to;
489 if not local_host or hosts[local_host].modules.dialback then 489 if not local_host or (hosts[local_host] and hosts[local_host].modules.dialback) then
490 attr["xmlns:db"] = 'jabber:server:dialback'; 490 attr["xmlns:db"] = 'jabber:server:dialback';
491 end 491 end
492 492
493 session.sends2s("<?xml version='1.0'?>"); 493 session.sends2s("<?xml version='1.0'?>");
494 session.sends2s(st.stanza("stream:stream", attr):top_tag()); 494 session.sends2s(st.stanza("stream:stream", attr):top_tag());