aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-07 20:48:37 +0200
committerKim Alvefur <zash@zash.se>2016-08-07 20:48:37 +0200
commit6cff8fa4749a367ac6dd4581a1e5bcfc4c8e3881 (patch)
tree943f7be7ef580ddd86a50ff131cba8e35f656f62 /plugins
parent12541a3029c7f7aec3f01091a473f261c337f502 (diff)
downloadprosody-6cff8fa4749a367ac6dd4581a1e5bcfc4c8e3881.tar.gz
prosody-6cff8fa4749a367ac6dd4581a1e5bcfc4c8e3881.zip
mod_s2s: Index session after checking if it exists (fixes traceback in case of a connection without a session having a read timeout)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index ea186cf0..ae9a746a 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -642,8 +642,8 @@ end
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