1
0
mirror of https://github.com/golang/go synced 2024-11-21 20:24:50 -07:00

websocket: fix binary frame size decoding

R=ukai, rsc
CC=golang-dev
https://golang.org/cl/166074
This commit is contained in:
Timo Savola 2010-02-19 18:40:09 -08:00 committed by Russ Cox
parent 0e2e066caa
commit 4f8a000e17

View File

@ -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
}
}