Mercurial > prosody-modules
comparison mod_websocket/mod_websocket.lua @ 1397:4e36b68d68da
mod_websocket: Handle pong messages
| author | Florian Zeitz <florob@babelmonkeys.de> |
|---|---|
| date | Mon, 28 Apr 2014 23:23:45 +0200 |
| parents | cc77341af5ee |
| children |
comparison
equal
deleted
inserted
replaced
| 1396:cf4e39334ef7 | 1397:4e36b68d68da |
|---|---|
| 317 return; | 317 return; |
| 318 elseif opcode == 0x9 then -- Ping frame | 318 elseif opcode == 0x9 then -- Ping frame |
| 319 frame.opcode = 0xA; | 319 frame.opcode = 0xA; |
| 320 conn:write(build_frame(frame)); | 320 conn:write(build_frame(frame)); |
| 321 return ""; | 321 return ""; |
| 322 elseif opcode == 0xA then -- Pong frame | |
| 323 module:log("warn", "Received unexpected pong frame: " .. tostring(frame.data)); | |
| 324 return ""; | |
| 322 else | 325 else |
| 323 log("warn", "Received frame with unsupported opcode %i", opcode); | 326 log("warn", "Received frame with unsupported opcode %i", opcode); |
| 324 return ""; | 327 return ""; |
| 325 end | 328 end |
| 326 | 329 |
