Skip to content

Commit d585ef0

Browse files
neilddmitshur
authored andcommitted
[internal-branch.go1.16-vendor] http2: avoid clientConnPool panic when NewClientConn fails
Updates golang/go#49076 Change-Id: Id5c1c40f9d8a07b7e6d399cc4e9f60ebe10ccf49 Reviewed-on: https://go-review.googlesource.com/c/net/+/353881 Trust: Damien Neil <[email protected]> Run-TryBot: Damien Neil <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/net/+/357090 Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent d06dfc7 commit d585ef0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http2/client_conn_pool.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ type addConnCall struct {
195195

196196
func (c *addConnCall) run(t *Transport, key string, tc *tls.Conn) {
197197
cc, err := t.NewClientConn(tc)
198-
cc.getConnCalled = true // already called by the net/http package
199198

200199
p := c.p
201200
p.mu.Lock()
202201
if err != nil {
203202
c.err = err
204203
} else {
204+
cc.getConnCalled = true // already called by the net/http package
205205
p.addConnLocked(key, cc)
206206
}
207207
delete(p.addConnCalls, key)

0 commit comments

Comments
 (0)