]> Cypherpunks repositories - gostls13.git/commit
net/http: fix Transport crash when abandoning dial which upgrades protos
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 13 Jan 2016 16:30:00 +0000 (16:30 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 13 Jan 2016 17:52:50 +0000 (17:52 +0000)
commit70ee525261f7d8adbcf58c2cf54efb7e7efb1c82
tree84a88b619c2d19bae41d3c42e9ce995ed89e5a62
parent4525571f7e911102636ce0af3bedcd467ee8b45c
net/http: fix Transport crash when abandoning dial which upgrades protos

When the Transport was creating an bound HTTP connection (protocol
unknown initially) and then ends up deciding it doesn't need it, a
goroutine sits around to clean up whatever the result was. That
goroutine made the false assumption that the result was always an
HTTP/1 connection or an error. It may also be an alternate protocol
in which case the *persistConn.conn net.Conn field is nil, and the
alt field is non-nil.

Fixes #13839

Change-Id: Ia4972e5eb1ad53fa00410b3466d4129c753e0871
Reviewed-on: https://go-review.googlesource.com/18573
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/export_test.go
src/net/http/transport.go
src/net/http/transport_test.go