Comparison

plugins/mod_s2s/mod_s2s.lua @ 7537:a0813737c6fa

mod_s2s: Index session after checking if it exists (fixes traceback in case of a connection without a session having a read timeout)
author Kim Alvefur <zash@zash.se>
date Sun, 07 Aug 2016 20:48:37 +0200
parent 7466:f28fa742def3
child 7542:0f92dc8e8b88
child 7638:a23b5cb8c22b
comparison
equal deleted inserted replaced
7533:4ef37ac69562 7537:a0813737c6fa
640 end 640 end
641 end 641 end
642 642
643 function listener.onreadtimeout(conn) 643 function listener.onreadtimeout(conn)
644 local session = sessions[conn]; 644 local session = sessions[conn];
645 local host = session.host or session.to_host;
646 if session then 645 if session then
646 local host = session.host or session.to_host;
647 return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session }); 647 return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
648 end 648 end
649 end 649 end
650 650
651 function listener.register_outgoing(conn, session) 651 function listener.register_outgoing(conn, session)