diff options
Diffstat (limited to 'src/net/http/transport.go')
-rw-r--r-- | src/net/http/transport.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net/http/transport.go b/src/net/http/transport.go index 66721190de..1f0763471b 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -590,6 +590,7 @@ var ( errReadLoopExiting = errors.New("http: persistConn.readLoop exiting") errServerClosedIdle = errors.New("http: server closed idle connection") errIdleConnTimeout = errors.New("http: idle connection timeout") + errNotCachingH2Conn = errors.New("http: not caching alternate protocol's connections") ) // transportReadFromServerError is used by Transport.readLoop when the @@ -633,6 +634,9 @@ func (t *Transport) tryPutIdleConn(pconn *persistConn) error { if pconn.isBroken() { return errConnBroken } + if pconn.alt != nil { + return errNotCachingH2Conn + } pconn.markReused() key := pconn.cacheKey |