Commit b67902fe authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

[release-branch.go1.7] net/http: update bundled http2

Updates bundled http2 for x/net/http2 git rev 8d4d01f0 for:

[release-branch.go1.7] http2: don't sniff first Request.Body byte in Transport until we have a conn
https://golang.org/cl/29074

Fixes #17071

Change-Id: I37fef5c2c0fdf499545f9af08abd5f9edb2da4c0
Reviewed-on: https://go-review.googlesource.com/29111
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarChris Broadfoot <cbro@golang.org>
parent 5a589904
// Code generated by golang.org/x/tools/cmd/bundle. // Code generated by golang.org/x/tools/cmd/bundle.
//go:generate bundle -o h2_bundle.go -prefix http2 golang.org/x/net/http2 //go:generate bundle -o h2_bundle.go -prefix http2 -underscore golang.org/x/net/http2
// Package http2 implements the HTTP/2 protocol. // Package http2 implements the HTTP/2 protocol.
// //
...@@ -5486,9 +5486,6 @@ func (cc *http2ClientConn) RoundTrip(req *Request) (*Response, error) { ...@@ -5486,9 +5486,6 @@ func (cc *http2ClientConn) RoundTrip(req *Request) (*Response, error) {
} }
hasTrailers := trailers != "" hasTrailers := trailers != ""
body, contentLen := http2bodyAndLength(req)
hasBody := body != nil
cc.mu.Lock() cc.mu.Lock()
cc.lastActive = time.Now() cc.lastActive = time.Now()
if cc.closed || !cc.canTakeNewRequestLocked() { if cc.closed || !cc.canTakeNewRequestLocked() {
...@@ -5496,6 +5493,9 @@ func (cc *http2ClientConn) RoundTrip(req *Request) (*Response, error) { ...@@ -5496,6 +5493,9 @@ func (cc *http2ClientConn) RoundTrip(req *Request) (*Response, error) {
return nil, http2errClientConnUnusable return nil, http2errClientConnUnusable
} }
body, contentLen := http2bodyAndLength(req)
hasBody := body != nil
// TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
var requestedGzip bool var requestedGzip bool
if !cc.t.disableCompression() && if !cc.t.disableCompression() &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment