Forráskód Böngészése

http2: make Transport.NewClientConn respect Transport.DisableKeepAlives

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: e35ab6278d5118605aa6de48ea625c099a427f6e
GitHub-Pull-Request: golang/net#48
Reviewed-on: https://go-review.googlesource.com/c/net/+/187958
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Moritz Fain 6 éve
szülő
commit
da9a3fd4c5
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      http2/transport.go

+ 1 - 1
http2/transport.go

@@ -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) {