]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] net/http: fix HTTP/2 idle pool tracing
authorTom Thorogood <me+google@tomthorogood.co.uk>
Sat, 14 Sep 2019 01:16:20 +0000 (01:16 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 25 Sep 2019 15:48:22 +0000 (15:48 +0000)
commita055bb937046f341ab74a7a471dc79e9e6b58af2
tree290042520c9d4adc3d527c8c886cecdc1a7b69a1
parentfb86bbb3155340860720ba6cba37cc0f18536796
[release-branch.go1.13] net/http: fix HTTP/2 idle pool tracing

CL 140357 caused HTTP/2 connections to be put in the idle pool, but
failed to properly guard the trace.GotConn call in getConn. dialConn
returns a minimal persistConn with conn == nil for HTTP/2 connections.
This persistConn was then returned from queueForIdleConn and caused the
httptrace.GotConnInfo passed into GotConn to have a nil Conn field.

HTTP/2 connections call GotConn themselves so leave it for HTTP/2 to call
GotConn as is done directly below.

Fixes #34285

Change-Id: If54bfaf6edb14f5391463f908efbef5bb8a5d78e
GitHub-Last-Rev: 2b7d66a1ce66b4424c4d0fca2b8e8b547d874136
GitHub-Pull-Request: golang/go#34283
Reviewed-on: https://go-review.googlesource.com/c/go/+/195237
Reviewed-by: Michael Fraenkel <michael.fraenkel@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 582d5194faec20c475ab93b45cf0520253dec4a9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/196579
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
src/net/http/export_test.go
src/net/http/transport.go
src/net/http/transport_test.go