x/net/websocket: fails to Receive a single frame sent in chunks from Browser #16945
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.5 to 1.7
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/matthew/code/go:/home/matthew/code/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build629490277=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
What did you do?
This is a very difficult issue to reproduce, as the browsers themselves don't always exhibit the problem.
Reproducing in our environment means sending a large >120k websocket message from the Browser (tested on Chrome) to the Go program from a "clean" browser - meaning either all caches, cookies cleared, or a new Incognito mode browser.
When sent to the server, the browser will chunk the frame into multiple parts, setting the hybiFrameReader.header.Fin bit to false
What did you expect to see?
I expected the whole frame to arrive.
What did you see instead?
arbitrary cut off of string frame.
My fix was to change the Receive function to check if the frame Fin was false, and if so, goto Again:
The text was updated successfully, but these errors were encountered: