diff options
author | Timo Savola <timo.savola@gmail.com> | 2010-02-19 18:40:09 -0800 |
---|---|---|
committer | Timo Savola <timo.savola@gmail.com> | 2010-02-19 18:40:09 -0800 |
commit | fa646d1119762b701602ecf537656c7388ca6140 (patch) | |
tree | 95d6c2c195eda3c87cefcd9ea9893d11db5ad9c5 /src/pkg/websocket/websocket.go | |
parent | d5c8368d1c8bc3f99604cb79b8c480bc62a65a2f (diff) | |
download | golang-fa646d1119762b701602ecf537656c7388ca6140.tar.gz |
websocket: fix binary frame size decoding
R=ukai, rsc
CC=golang-dev
http://codereview.appspot.com/166074
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/websocket/websocket.go')
-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 80ca49b94..bcb42f508 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 } } |