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: flow control over payload length, not data length #16556

Closed
bradfitz opened this issue Jul 31, 2016 · 3 comments
Closed

x/net/http2: flow control over payload length, not data length #16556

bradfitz opened this issue Jul 31, 2016 · 3 comments
Assignees
Milestone

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jul 31, 2016

http://httpwg.org/specs/rfc7540.html#rfc.section.6.1 says:

The entire DATA frame payload is included in flow control, including the Pad Length and Padding fields if present.

We ignore the pad length and padding fields in our accounting.

I thought the fix was as easy as changing len(f.Data()) to f.Length in a few places, but then our accounting would be off when we return the flow control tokens on bytes read later. We'll probably want to just immediately return the flow control tokens for any padding immediately, in both the client and server.

@bradfitz bradfitz added this to the Go1.8Early milestone Jul 31, 2016
@bradfitz bradfitz self-assigned this Jul 31, 2016
@bradfitz bradfitz modified the milestones: Go1.7Maybe, Go1.8Early Jul 31, 2016
@bradfitz

This comment has been minimized.

Copy link
Contributor Author

@bradfitz bradfitz commented Jul 31, 2016

Sent https://go-review.googlesource.com/25382 for this too. The CL should be pretty low risk for people who don't use padding (no new code paths), but pretty valuable to those who do, so I think we should probably include it in 1.7.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jul 31, 2016

CL https://golang.org/cl/25382 mentions this issue.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Aug 2, 2016

CL https://golang.org/cl/25388 mentions this issue.

gopherbot pushed a commit that referenced this issue Aug 2, 2016
Updates bundled http2 to x/net/http2 rev 28d1bd4f for:

    http2: make Transport work around mod_h2 bug
    https://golang.org/cl/25362

    http2: don't ignore DATA padding in flow control
    https://golang.org/cl/25382

Updates #16519
Updates #16556
Updates #16481

Change-Id: I51f5696e977c91bdb2d80d2d56b8a78e3222da3f
Reviewed-on: https://go-review.googlesource.com/25388
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Aug 2, 2017
c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018
http://httpwg.org/specs/rfc7540.html#rfc.section.6.1 says:

> The entire DATA frame payload is included in flow control, including
> the Pad Length and Padding fields if present.

But we were just ignoring the padding and pad length, which could lead
to clients and servers getting out of sync and deadlock if peers used
padding. (Go never does, so it didn't affect Go<->Go)

In the process, fix a lingering bug from golang/go#16481 where we
didn't account for flow control returned to peers in the stream's
inflow, despite sending the peer a WINDOW_UPDATE.

Fixes golang/go#16556
Updates golang/go#16481

Change-Id: If7150fa8f0da92a60f34af9c3f754a0346526ece
Reviewed-on: https://go-review.googlesource.com/25382
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
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
2 participants
You can’t perform that action at this time.