mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
fix websocket bugs (#1359)
* fix websocket bugs * revert write_frame Co-authored-by: 郑非凡 <efve.zff@alibaba-inc.com>
This commit is contained in:
@@ -261,6 +261,7 @@ local function resolve_accept(self, options)
|
||||
try_handle(self, "handshake", header, url)
|
||||
local recv_count = 0
|
||||
local recv_buf = {}
|
||||
local first_op
|
||||
while true do
|
||||
if _isws_closed(self.id) then
|
||||
try_handle(self, "close")
|
||||
@@ -286,11 +287,13 @@ local function resolve_accept(self, options)
|
||||
if recv_count > MAX_FRAME_SIZE then
|
||||
error("payload_len is too large")
|
||||
end
|
||||
first_op = first_op or op
|
||||
if fin then
|
||||
local s = table.concat(recv_buf)
|
||||
try_handle(self, "message", s, op)
|
||||
try_handle(self, "message", s, first_op)
|
||||
recv_buf = {} -- clear recv_buf
|
||||
recv_count = 0
|
||||
first_op = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -470,7 +473,6 @@ function M.read(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
assert(false)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user