Changeset

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
parents 7533:4ef37ac69562
children 7538:a3a4ed0d34f4
files plugins/mod_s2s/mod_s2s.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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