mod_s2s: Fire read timeout event on correct virtualhost for incoming connections
authorKim Alvefur <zash@zash.se>
Wed, 6 May 2015 11:35:34 +0000 (13:35 +0200)
committerKim Alvefur <zash@zash.se>
Wed, 6 May 2015 11:35:34 +0000 (13:35 +0200)
plugins/mod_s2s/mod_s2s.lua

index 1ce63a8bd81de7842a02105158a4f793e9ca5821..060e04f6ea30adea6ec83ad883d557e4af2656d5 100644 (file)
@@ -625,8 +625,9 @@ end
 
 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