plugins/mod_s2s/mod_s2s.lua
changeset 6661 65563530375b
parent 6633 6735e2d735d6
child 6669 42fdc8dddf04
child 6688 3f05b255937f
--- a/plugins/mod_s2s/mod_s2s.lua	Tue May 05 12:21:32 2015 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua	Wed May 06 13:35:34 2015 +0200
@@ -625,8 +625,9 @@
 
 function listener.onreadtimeout(conn)
 	local session = sessions[conn];
+	local host = session.host or session.to_host;
 	if session then
-		return (hosts[session.host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
+		return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
 	end
 end