components/golang-17/patches/0019-release-branch.go1.7-net-http-update-bundled-http2.patch
changeset 7518 c388d4e1d3ad
equal deleted inserted replaced
7517:42ae3923b8fe 7518:c388d4e1d3ad
       
     1 From b67902fee7b56dd3235b2f489550c279248bacb9 Mon Sep 17 00:00:00 2001
       
     2 From: Brad Fitzpatrick <[email protected]>
       
     3 Date: Tue, 13 Sep 2016 19:32:39 +0000
       
     4 Subject: [PATCH 19/38] [release-branch.go1.7] net/http: update bundled http2
       
     5 
       
     6 Updates bundled http2 for x/net/http2 git rev 8d4d01f0 for:
       
     7 
       
     8 [release-branch.go1.7] http2: don't sniff first Request.Body byte in Transport until we have a conn
       
     9 https://golang.org/cl/29074
       
    10 
       
    11 Fixes #17071
       
    12 
       
    13 Change-Id: I37fef5c2c0fdf499545f9af08abd5f9edb2da4c0
       
    14 Reviewed-on: https://go-review.googlesource.com/29111
       
    15 Run-TryBot: Brad Fitzpatrick <[email protected]>
       
    16 TryBot-Result: Gobot Gobot <[email protected]>
       
    17 Reviewed-by: Chris Broadfoot <[email protected]>
       
    18 ---
       
    19  src/net/http/h2_bundle.go | 8 ++++----
       
    20  1 file changed, 4 insertions(+), 4 deletions(-)
       
    21 
       
    22 diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
       
    23 index a41e3ca..80c02d0 100644
       
    24 --- a/src/net/http/h2_bundle.go
       
    25 +++ b/src/net/http/h2_bundle.go
       
    26 @@ -1,5 +1,5 @@
       
    27  // Code generated by golang.org/x/tools/cmd/bundle.
       
    28 -//go:generate bundle -o h2_bundle.go -prefix http2 golang.org/x/net/http2
       
    29 +//go:generate bundle -o h2_bundle.go -prefix http2 -underscore golang.org/x/net/http2
       
    30  
       
    31  // Package http2 implements the HTTP/2 protocol.
       
    32  //
       
    33 @@ -5486,9 +5486,6 @@ func (cc *http2ClientConn) RoundTrip(req *Request) (*Response, error) {
       
    34  	}
       
    35  	hasTrailers := trailers != ""
       
    36  
       
    37 -	body, contentLen := http2bodyAndLength(req)
       
    38 -	hasBody := body != nil
       
    39 -
       
    40  	cc.mu.Lock()
       
    41  	cc.lastActive = time.Now()
       
    42  	if cc.closed || !cc.canTakeNewRequestLocked() {
       
    43 @@ -5496,6 +5493,9 @@ func (cc *http2ClientConn) RoundTrip(req *Request) (*Response, error) {
       
    44  		return nil, http2errClientConnUnusable
       
    45  	}
       
    46  
       
    47 +	body, contentLen := http2bodyAndLength(req)
       
    48 +	hasBody := body != nil
       
    49 +
       
    50  	// TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
       
    51  	var requestedGzip bool
       
    52  	if !cc.t.disableCompression() &&
       
    53 -- 
       
    54 2.7.4
       
    55