# HG changeset patch # User Florian Zeitz # Date 1338139837 -7200 # Node ID 04662cc35280efaa1b647c8d763f2ce39ba15638 # Parent 5acc203972f31d1d5706574015ebb2d250d86e06 mod_websocket: Answer ping frames diff -r 5acc203972f3 -r 04662cc35280 mod_websocket/mod_websocket.lua --- a/mod_websocket/mod_websocket.lua Sun May 27 19:05:07 2012 +0200 +++ b/mod_websocket/mod_websocket.lua Sun May 27 19:30:37 2012 +0200 @@ -262,8 +262,12 @@ local frame = parse_frame(data); module:log("debug", "Websocket received: %s (%i bytes)", frame.data, #frame.data); - if frame.opcode == 0x00 or frame.opcode == 0x01 then -- Text or continuation frame + if frame.opcode == 0x0 or frame.opcode == 0x1 then -- Text or continuation frame buffer = buffer .. frame.data; + elseif frame.opcode == 0x9 then -- Ping frame + frame.opcode = 0xA; + conn:write(build_frame(frame)); + return; else log("warn", "Received frame with unsupported opcode %i", frame.opcode); return;