Skip to content

Commit 217300f

Browse files
committed
http/websocket: fix mid-size frames sometimes failing to be received (fixes #140)
1 parent 169c1a7 commit 217300f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http/websocket.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ local function read_frame(sock, deadline)
241241
if frame.length == 126 then
242242
extra_fill_unget = assert(sock:xread(2, "b", 0))
243243
frame.length = sunpack(">I2", extra_fill_unget)
244-
fill_length = fill_length - 2
244+
fill_length = fill_length - 2 + frame.length
245245
elseif frame.length == 127 then
246246
extra_fill_unget = assert(sock:xread(8, "b", 0))
247247
frame.length = sunpack(">I8", extra_fill_unget)

0 commit comments

Comments
 (0)