]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix the handling of messages of length 126 in the draft-10 Websocket implementation.
authorFlorian Diebold <flodiebold@gmail.com>
Sat, 17 Sep 2011 22:17:47 +0000 (00:17 +0200)
committerBen Darnell <ben@bendarnell.com>
Sun, 18 Sep 2011 22:36:54 +0000 (15:36 -0700)
tornado/websocket.py

index a65cdc6b76e9f24cbf03cf253cfc3f432e1a8739..3a17f93e1058efc1de6a0cf02f80a2d9c3ec50cf 100644 (file)
@@ -390,7 +390,7 @@ class WebSocketProtocol8(WebSocketProtocol):
             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)