Changeset

7340:7dea28dafc49

mod_websocket: Fix read timeout handler (thanks mt)
author Kim Alvefur <zash@zash.se>
date Wed, 06 Apr 2016 14:44:51 +0200
parents 7339:b5565715fce8
children 7341:aa94cd27df4d 7342:79a5db780e8b
files plugins/mod_websocket.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_websocket.lua	Wed Dec 18 18:11:47 2013 -0500
+++ b/plugins/mod_websocket.lua	Wed Apr 06 14:44:51 2016 +0200
@@ -291,7 +291,10 @@
 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);