From: Kim Alvefur Date: Wed, 6 Apr 2016 12:44:51 +0000 (+0200) Subject: mod_websocket: Fix read timeout handler (thanks mt) X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=27ac024a58d550f03ca32cac0dbbae7ef5a74d85;p=prosody.git mod_websocket: Fix read timeout handler (thanks mt) --- diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua index 086eab62..a3f5318c 100644 --- a/plugins/mod_websocket.lua +++ b/plugins/mod_websocket.lua @@ -291,7 +291,10 @@ function handle_request(event) end local function keepalive(event) - return conn:write(build_frame({ opcode = 0x9, })); + local session = event.session; + if session.open_stream == session_open_stream then + return session.conn:write(build_frame({ opcode = 0x9, })); + end end module:hook("c2s-read-timeout", keepalive, -0.9);