Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/http2: The starting streamid for client should be 3 instead of 1 when AllowHTTP is set. #25230

Closed
snowie2000 opened this issue May 3, 2018 · 3 comments

Comments

@snowie2000
Copy link

@snowie2000 snowie2000 commented May 3, 2018

Please answer these questions before submitting your issue. Thanks!

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

1.10

Does this issue reproduce with the latest release?

yes

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

W64

transport.go line 537:
nextStreamID: 1,
as http2-spec stated in https://http2.github.io/http2-spec/#discover-http

Stream 1 is implicitly "half-closed" from the client toward the server (see Section 5.1), since the request is completed as an HTTP/1.1 request. After commencing the HTTP/2 connection, stream 1 is used for the response.

and https://http2.github.io/http2-spec/#StreamIdentifiers

HTTP/1.1 requests that are upgraded to HTTP/2 (see Section 3.2) are responded to with a stream identifier of one (0x1). After the upgrade completes, stream 0x1 is "half-closed (local)" to the client. Therefore, stream 0x1 cannot be selected as a new stream identifier by a client that upgrades from HTTP/1.1.

The next stream ID for h2c should therefore starts from 3

@gopherbot gopherbot added this to the Unreleased milestone May 3, 2018
@snowie2000 snowie2000 changed the title x/http2: The starting streamid for client should be 3 instead of 1 when AllowHTTP is set. x/net/http2: The starting streamid for client should be 3 instead of 1 when AllowHTTP is set. May 4, 2018
@bradfitz

This comment has been minimized.

Copy link
Contributor

@bradfitz bradfitz commented May 4, 2018

Sounds fine to start at 3 instead of 1 iff AllowHTTP is true. Somebody want to send a change?

@wingyplus

This comment has been minimized.

Copy link
Contributor

@wingyplus wingyplus commented May 6, 2018

I can do this.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented May 7, 2018

Change https://golang.org/cl/111835 mentions this issue: x/net/http2: set nextStreamID to 3 when AlloHTTP is set

@golang golang locked and limited conversation to collaborators May 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.