Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(506)

Issue 2302042: code review 2302042: Fix websocket's Read to handle reading a fragment of a ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 9 months ago by ukai
Modified:
14 years, 9 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

Fix websocket's Read to handle reading a fragment of a frame. It remembers that there is more data coming and returns that data to the next Read. Fixes issue 1145.

Patch Set 1 #

Patch Set 2 : code review 2302042: Fix websocket's Read to handle reading a fragment of a ... #

Total comments: 5

Patch Set 3 : code review 2302042: Fix websocket's Read to handle reading a fragment of a ... #

Total comments: 1

Patch Set 4 : code review 2302042: Fix websocket's Read to handle reading a fragment of a ... #

Patch Set 5 : code review 2302042: Fix websocket's Read to handle reading a fragment of a ... #

Total comments: 2

Patch Set 6 : code review 2302042: Fix websocket's Read to handle reading a fragment of a ... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -24 lines) Patch
M src/pkg/websocket/websocket.go View 1 2 3 4 5 3 chunks +41 lines, -24 lines 0 comments Download
M src/pkg/websocket/websocket_test.go View 1 2 3 2 chunks +75 lines, -0 lines 0 comments Download

Messages

Total messages: 16
ukai
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 9 months ago (2010-09-30 09:41:40 UTC) #1
rsc1
http://codereview.appspot.com/2302042/diff/2001/src/pkg/websocket/websocket.go File src/pkg/websocket/websocket.go (right): http://codereview.appspot.com/2302042/diff/2001/src/pkg/websocket/websocket.go#newcode75 src/pkg/websocket/websocket.go:75: if ws.frameText != nil { I'm a little confused ...
14 years, 9 months ago (2010-09-30 17:57:12 UTC) #2
ukai
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 9 months ago (2010-10-01 06:37:29 UTC) #3
ukai
http://codereview.appspot.com/2302042/diff/2001/src/pkg/websocket/websocket_test.go File src/pkg/websocket/websocket_test.go (right): http://codereview.appspot.com/2302042/diff/2001/src/pkg/websocket/websocket_test.go#newcode224 src/pkg/websocket/websocket_test.go:224: t.Errorf("Read: expected os.E2BIG got %v", err) On 2010/09/30 17:57:12, ...
14 years, 9 months ago (2010-10-01 06:39:19 UTC) #4
rsc1
Please add a test of the length skipping code.
14 years, 9 months ago (2010-10-01 15:58:41 UTC) #5
rsc1
http://codereview.appspot.com/2302042/diff/9001/src/pkg/websocket/websocket.go File src/pkg/websocket/websocket.go (right): http://codereview.appspot.com/2302042/diff/9001/src/pkg/websocket/websocket.go#newcode102 src/pkg/websocket/websocket.go:102: ws.data = line Websocket is such a bizarre protocol. ...
14 years, 9 months ago (2010-10-01 16:04:02 UTC) #6
rsc
>> Why should Read ever return E2BIG? > > websocket is not stream-based, but message-based, ...
14 years, 9 months ago (2010-10-01 16:15:02 UTC) #7
ukai
On 2010/10/01 16:15:02, rsc wrote: > >> Why should Read ever return E2BIG? > > ...
14 years, 9 months ago (2010-10-04 05:24:30 UTC) #8
rsc
> So, in TestSamllBuffer, the second_msg should be "hello, world", instead > of "world" ? ...
14 years, 9 months ago (2010-10-04 10:30:24 UTC) #9
ukai
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 9 months ago (2010-10-04 10:53:59 UTC) #10
ukai
ping. I think Read() for small buffer returns data for the buffer, and next Read() ...
14 years, 9 months ago (2010-10-18 07:44:50 UTC) #11
rsc1
LGTM Please fix the one thing below. (If err == nil then it succeeded and ...
14 years, 9 months ago (2010-10-18 15:13:43 UTC) #12
ukai
http://codereview.appspot.com/2302042/diff/22001/src/pkg/websocket/websocket.go File src/pkg/websocket/websocket.go (right): http://codereview.appspot.com/2302042/diff/22001/src/pkg/websocket/websocket.go#newcode114 src/pkg/websocket/websocket.go:114: if ws.data[len(ws.data)-1] == '\xff' { On 2010/10/18 15:13:43, rsc1 ...
14 years, 9 months ago (2010-10-19 02:29:31 UTC) #13
ukai
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 9 months ago (2010-10-19 02:29:51 UTC) #14
rsc1
LGTM
14 years, 9 months ago (2010-10-21 02:35:59 UTC) #15
rsc
14 years, 9 months ago (2010-10-21 02:36:12 UTC) #16
*** Submitted as http://code.google.com/p/go/source/detail?r=df7bb16ecb99 ***

web socket: fix short Read

Fixes issue 1145.

R=rsc
CC=golang-dev
http://codereview.appspot.com/2302042

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b