Skip to content

Commit

Permalink
http2: make Transport.NewClientConn respect Transport.DisableKeepAlives
Browse files Browse the repository at this point in the history
While in http/1.1 the `http.Transport.DisableKeepAlives` directive disallows re-usage of the connection, in http2 it's currently implemented as "close the connection as soon as possible" (when the connection is idle).

Fixes golang/go#33260

Change-Id: I5c167029062168f53a2cd15b5fbd19c1589cf175
GitHub-Last-Rev: e35ab62
GitHub-Pull-Request: #48
Reviewed-on: https://go-review.googlesource.com/c/net/+/187958
Reviewed-by: Brad Fitzpatrick <[email protected]>
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
maurice2k authored and bradfitz committed Oct 14, 2019
1 parent 2ba7206 commit da9a3fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http2/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ func (t *Transport) expectContinueTimeout() time.Duration {
}

func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) {
return t.newClientConn(c, false)
return t.newClientConn(c, t.disableKeepAlives())
}

func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) {
Expand Down

0 comments on commit da9a3fd

Please sign in to comment.