mirror of
https://github.com/golang/go
synced 2024-11-19 10:44:47 -07:00
91b910b7e2
If a user starts two HTTP requests when no http2 connection is available, both end up creating new TCP connections, since the server's protocol (h1 or h2) isn't yet known. Once it turns out that the server supports h2, one of the connections is useless. Previously we kept upgrading both TLS connections to h2 (SETTINGS frame exchange, etc). Now the unnecessary connections are closed instead, before the h2 preface/SETTINGS. Updates x/net/http2 to git rev a8e212f3d for https://golang.org/cl/18675 This CL contains the tests for https://golang.org/cl/18675 Semi-related change noticed while writing the tests: now that we have TLSNextProto in Go 1.6, which consults the TLS ConnectionState.NegotiatedProtocol, we have to gurantee that the TLS handshake has been done before we look at the ConnectionState. So add that check after the DialTLS hook. (we never documented that users have to call Handshake, so do it for them, now that it matters) Updates #13957 Change-Id: I9a70e9d1282fe937ea654d9b1269c984c4e366c0 Reviewed-on: https://go-review.googlesource.com/18676 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> |
||
---|---|---|
.. | ||
cgi | ||
cookiejar | ||
fcgi | ||
httptest | ||
httputil | ||
internal | ||
pprof | ||
testdata | ||
client_test.go | ||
client.go | ||
clientserver_test.go | ||
cookie_test.go | ||
cookie.go | ||
doc.go | ||
example_test.go | ||
export_test.go | ||
filetransport_test.go | ||
filetransport.go | ||
fs_test.go | ||
fs.go | ||
h2_bundle.go | ||
header_test.go | ||
header.go | ||
http_test.go | ||
jar.go | ||
lex_test.go | ||
lex.go | ||
main_test.go | ||
method.go | ||
npn_test.go | ||
proxy_test.go | ||
race.go | ||
range_test.go | ||
readrequest_test.go | ||
request_test.go | ||
request.go | ||
requestwrite_test.go | ||
response_test.go | ||
response.go | ||
responsewrite_test.go | ||
serve_test.go | ||
server.go | ||
sniff_test.go | ||
sniff.go | ||
status.go | ||
transfer_test.go | ||
transfer.go | ||
transport_test.go | ||
transport.go | ||
triv.go |