Parse the mask flag and length in the order they appear in the protocol.

This commit is contained in:
James Coglan
2015-07-07 20:49:29 +01:00
parent e39fa15c07
commit 91653036ce
+1 -1
View File
@@ -305,8 +305,8 @@ module WebSocket
end
def parse_length(data)
@frame.length = (data & LENGTH)
@frame.masked = (data & MASK) == MASK
@frame.length = (data & LENGTH)
if @frame.length >= 0 and @frame.length <= 125
@stage = @frame.masked ? 3 : 4