Skip to content

Commit

Permalink
[internal-branch.go1.17-vendor] http2: avoid clientConnPool panic whe…
Browse files Browse the repository at this point in the history
…n NewClientConn fails

Updates golang/go#49077

Change-Id: Id5c1c40f9d8a07b7e6d399cc4e9f60ebe10ccf49
Reviewed-on: https://go-review.googlesource.com/c/net/+/353881
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/net/+/357685
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
neild authored and dmitshur committed Oct 29, 2021
1 parent 07f3af1 commit afdbe73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 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 afdbe73

Please sign in to comment.