Commit fa74a6e6 authored by Joel Martin's avatar Joel Martin

websocket.py: fix payload length calculation.

Pull from websockify 0da91c7.
parent 48f26d79
......@@ -225,7 +225,7 @@ Sec-WebSocket-Accept: %s\r
payload_len = len(buf)
if payload_len <= 125:
header = struct.pack('>BB', b1, payload_len)
elif payload_len > 125 and payload_len <= 65536:
elif payload_len > 125 and payload_len < 65536:
header = struct.pack('>BBH', b1, 126, payload_len)
elif payload_len >= 65536:
header = struct.pack('>BBQ', b1, 127, payload_len)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment