diff options
author | Timo Savola <timo.savola@gmail.com> | 2010-02-19 18:40:09 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-02-19 18:40:09 -0800 |
commit | 4f8a000e1735bac3db06d61fe9e78a649d381378 (patch) | |
tree | e79415e3c3ca2393053839281faf2e583501aa62 | |
parent | 0e2e066caac2b957bca22cd18206be825cbdcd94 (diff) | |
download | go-4f8a000e1735bac3db06d61fe9e78a649d381378.tar.gz go-4f8a000e1735bac3db06d61fe9e78a649d381378.zip |
websocket: fix binary frame size decoding
R=ukai, rsc
CC=golang-dev
https://golang.org/cl/166074
-rw-r--r-- | src/pkg/websocket/websocket.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pkg/websocket/websocket.go b/src/pkg/websocket/websocket.go index 80ca49b947..bcb42f508a 100644 --- a/src/pkg/websocket/websocket.go +++ b/src/pkg/websocket/websocket.go @@ -64,9 +64,8 @@ func (ws *Conn) Read(msg []byte) (n int, err os.Error) { if err != nil { return n, err } - if (c & 0x80) == 0x80 { - length = length*128 + int(c&0x7f) - } else { + length = length*128 + int(c&0x7f) + if (c & 0x80) == 0 { break } } |