-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[internal-branch.go1.16-vendor] http2: close request body after early…
… RoundTrip failures The RoundTrip contract requires that the request Body be closed, even when an error occurs sending the request. Fix several cases where the body was not closed by hoisting the Close call to Transport.RoundTripOpt. Now ClientConn.roundTrip takes responsibility for closing the body once the body write begins; otherwise, the caller does so. Fix the case where a new body is acquired via Request.GetBody to close the previous body, matching net/http's behavior. Updates golang/go#49076 Change-Id: Id9dc682d4d86a1c255c7c0d864208ff76ed53eb2 Reviewed-on: https://go-review.googlesource.com/c/net/+/349489 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/c/net/+/356980 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
- Loading branch information
Showing
2 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters