Skip to content

net/http: HTTP/2 SETTINGS frame being read incorrectly #37059

Closed
@x04

Description

@x04

What version of Go are you using (go version)?

$ go version
go version go1.14beta1 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\\AppData\Local\go-build
set GOENV=C:\Users\\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS= -mod=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\\go
set GOPRIVATE=
set GOPROXY=direct
set GOROOT=C:\Users\\go\go1.14beta1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\\go\go1.14beta1\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\\go\go1.14beta1\src\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\\AppData\Local\Temp\go-build787882606=/tmp/go-build -gno-record-gcc-switches

What did you do?

I outputted all HTTP/2 frames that are received by the net/http server corresponding to their type, and when looking at the SETTINGS frames the first settings ID always appears to be wrong.

For example, the first setting from Chrome is 0x1 or SETTINGS_HEADER_TABLE_SIZE, but the ID outputted by when looping through the settings in the frame is 239 when the expected value is 1.

Another example would be when I used Go's http.Client and the first setting is always 0x2 or SETTINGS_ENABLE_PUSH, but the outputted value 16384 when the expected value is 2.

What did you expect to see?

(Read above for explanation on what I'm talking about)
Expected first setting ID from latest Chrome: 1, SETTINGS_HEADER_TABLE_SIZE
Expected first setting ID from Go's http client: 2, SETTINGS_ENABLE_PUSH

What did you see instead?

(Read above for explanation on what I'm talking about)
"Received" first setting ID from latest Chrome: 239
"Received" first setting ID from Go's http client: 16384

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions