Skip to content

Commit

Permalink
off-by-one comparison for large frames
Browse files Browse the repository at this point in the history
  • Loading branch information
tilgovi committed Nov 7, 2011
1 parent b847c95 commit a60d993
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/websocket/base_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def encode_hybi(opcode, buf):
byte1 = 0x80 | (opcode & 0x0f) # FIN + opcode
if blen < 126:
header = struct.pack('!BB', byte1, blen)
elif blen > 125 and blen <= 65536:
elif blen > 125 and blen < 65536:
header = struct.pack('!BBH', byte1, 126, blen)
elif blen >= 65536:
header = struct.pack('!BBQ', byte1, 127, blen)
Expand Down

0 comments on commit a60d993

Please sign in to comment.