mod_s2s: Index session after checking if it exists (fixes traceback in case of a connection without a session having a read timeout)
--- a/plugins/mod_s2s/mod_s2s.lua Fri Jul 29 13:20:02 2016 +0100
+++ b/plugins/mod_s2s/mod_s2s.lua Sun Aug 07 20:48:37 2016 +0200
@@ -642,8 +642,8 @@
function listener.onreadtimeout(conn)
local session = sessions[conn];
- local host = session.host or session.to_host;
if session then
+ local host = session.host or session.to_host;
return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
end
end