Skip to content

Commit

Permalink
Fix the handling of messages of length 126 in the draft-10 Websocket …
Browse files Browse the repository at this point in the history
…implementation.
  • Loading branch information
flodiebold authored and bdarnell committed Sep 18, 2011
1 parent e811959 commit 662d8ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tornado/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def _write_frame(self, fin, opcode, data):
finbit = 0
frame = struct.pack("B", finbit | opcode)
l = len(data)
if l <= 126:
if l < 126:
frame += struct.pack("B", l)
elif l <= 0xFFFF:
frame += struct.pack("!BH", 126, l)
Expand Down

0 comments on commit 662d8ac

Please sign in to comment.