]> Cypherpunks repositories - gostls13.git/commitdiff
websocket: fix binary frame size decoding
authorTimo Savola <timo.savola@gmail.com>
Sat, 20 Feb 2010 02:40:09 +0000 (18:40 -0800)
committerRuss Cox <rsc@golang.org>
Sat, 20 Feb 2010 02:40:09 +0000 (18:40 -0800)
R=ukai, rsc
CC=golang-dev
https://golang.org/cl/166074

src/pkg/websocket/websocket.go

index 80ca49b9474c2eec16bbd35d6d8cc8753c2dbdbe..bcb42f508ab8c17afee37a152f7968f90bc74e99 100644 (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
                                }
                        }