mod_s2s: Fire read timeout event on correct virtualhost for incoming connections
authorKim Alvefur <zash@zash.se>
Wed, 06 May 2015 13:35:34 +0200
changeset 6661 65563530375b
parent 6660 f1af4edd5722
child 6668 e923d7cb8430
mod_s2s: Fire read timeout event on correct virtualhost for incoming connections
plugins/mod_s2s/mod_s2s.lua
--- 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