Skip to content

Commit d4b1ae0

Browse files
committed
http2: avoid clientConnPool panic when NewClientConn fails
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]>
1 parent 69340ce commit d4b1ae0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http2/client_conn_pool.go

Lines changed: 1 addition & 1 deletion
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)