mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
A Pong frame sent in response to a Ping frame must have identical "Application data" as found in the message body of the Ping frame being replied to.
This commit is contained in:
@@ -267,7 +267,7 @@ local function resolve_accept(self)
|
|||||||
try_handle(self, "close", code, reason)
|
try_handle(self, "close", code, reason)
|
||||||
break
|
break
|
||||||
elseif op == "ping" then
|
elseif op == "ping" then
|
||||||
write_frame(self, "pong")
|
write_frame(self, "pong", payload_data)
|
||||||
try_handle(self, "ping")
|
try_handle(self, "ping")
|
||||||
elseif op == "pong" then
|
elseif op == "pong" then
|
||||||
try_handle(self, "pong")
|
try_handle(self, "pong")
|
||||||
@@ -448,7 +448,7 @@ function M.read(id)
|
|||||||
_close_websocket(ws_obj)
|
_close_websocket(ws_obj)
|
||||||
return false, payload_data
|
return false, payload_data
|
||||||
elseif op == "ping" then
|
elseif op == "ping" then
|
||||||
write_frame(ws_obj, "pong")
|
write_frame(ws_obj, "pong", payload_data)
|
||||||
elseif op ~= "pong" then -- op is frame, text binary
|
elseif op ~= "pong" then -- op is frame, text binary
|
||||||
if fin and not recv_buf then
|
if fin and not recv_buf then
|
||||||
return payload_data
|
return payload_data
|
||||||
|
|||||||
Reference in New Issue
Block a user