Software /
code /
prosody
Comparison
plugins/mod_websocket.lua @ 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 |
parent | 7315:4fd984d1e445 |
child | 7716:779a9ef6b4fd |
comparison
equal
deleted
inserted
replaced
7339:b5565715fce8 | 7340:7dea28dafc49 |
---|---|
289 | 289 |
290 return ""; | 290 return ""; |
291 end | 291 end |
292 | 292 |
293 local function keepalive(event) | 293 local function keepalive(event) |
294 return conn:write(build_frame({ opcode = 0x9, })); | 294 local session = event.session; |
295 if session.open_stream == session_open_stream then | |
296 return session.conn:write(build_frame({ opcode = 0x9, })); | |
297 end | |
295 end | 298 end |
296 | 299 |
297 module:hook("c2s-read-timeout", keepalive, -0.9); | 300 module:hook("c2s-read-timeout", keepalive, -0.9); |
298 | 301 |
299 function module.add_host(module) | 302 function module.add_host(module) |