Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add. Decode reserved bits in header. #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/websocket/frame.lua
Original file line number Diff line number Diff line change
@@ -25,7 +25,10 @@ local bits = function(...)
return n
end

local bit_7 = bits(7)
local bit_7 = bits(7)
local bit_6 = bits(6)
local bit_5 = bits(5)
local bit_4 = bits(4)
local bit_0_3 = bits(0,1,2,3)
local bit_0_6 = bits(0,1,2,3,4,5,6)

@@ -147,7 +150,10 @@ local decode = function(encoded)
end
bytes = bytes + payload
end
return decoded,fin,opcode,encoded_bak:sub(bytes+1),mask
local rsv1 = band(header,bit_6) ~= 0
local rsv2 = band(header,bit_5) ~= 0
local rsv3 = band(header,bit_4) ~= 0
return decoded,fin,opcode,encoded_bak:sub(bytes+1),mask,rsv1,rsv2,rsv3
end

local encode_close = function(code,reason)