Skip to content

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

Closed
@snowie2000

Description

@snowie2000

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions