Skip to content

Commit

Permalink
[internal-branch.go1.16-vendor] http2: avoid clientConnPool panic whe…
Browse files Browse the repository at this point in the history
…n 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]>
  • Loading branch information
neild authored and dmitshur committed Oct 29, 2021
1 parent d06dfc7 commit d585ef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http2/client_conn_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ type addConnCall struct {

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

p := c.p
p.mu.Lock()
if err != nil {
c.err = err
} else {
cc.getConnCalled = true // already called by the net/http package
p.addConnLocked(key, cc)
}
delete(p.addConnCalls, key)
Expand Down

0 comments on commit d585ef0

Please sign in to comment.