1
0
mirror of https://github.com/golang/go synced 2024-11-19 10:44:47 -07:00
go/src/net/http
Brad Fitzpatrick 91b910b7e2 net/http: update bundled http2
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>
2016-01-15 18:06:34 +00:00
..
cgi
cookiejar
fcgi
httptest net/http/httptest: don't crash in mime sniffing if HeaderMap is nil 2015-12-10 18:51:54 +00:00
httputil net/http, net/http/httputil: fix nits found by vet 2016-01-07 01:01:33 +00:00
internal
pprof net/http/pprof: stop profiling if client's connection closes 2016-01-06 05:51:38 +00:00
testdata
client_test.go net/http: make Client use Request.Cancel for timeouts instead of CancelRequest 2016-01-05 22:55:22 +00:00
client.go net/http: make Client use Request.Cancel for timeouts instead of CancelRequest 2016-01-05 22:55:22 +00:00
clientserver_test.go net/http: update bundled http2 2016-01-15 18:06:34 +00:00
cookie_test.go
cookie.go
doc.go net/http: document GODEBUG settings, update bundled http2 2016-01-08 00:56:28 +00:00
example_test.go
export_test.go net/http: fix Transport crash when abandoning dial which upgrades protos 2016-01-13 17:52:50 +00:00
filetransport_test.go
filetransport.go
fs_test.go net/http: run more tests in http2 mode 2015-12-10 04:43:08 +00:00
fs.go net/http: define File as an io.Seeker 2015-11-30 20:43:39 +00:00
h2_bundle.go net/http: update bundled http2 2016-01-15 18:06:34 +00:00
header_test.go
header.go net/http: make Client use Request.Cancel for timeouts instead of CancelRequest 2016-01-05 22:55:22 +00:00
http_test.go
jar.go
lex_test.go
lex.go net/http: fix validHeaderValue yet again, excluding the DEL CTL byte 2016-01-08 19:01:32 +00:00
main_test.go net/http: add mechanism for marking flaky http tests 2016-01-06 21:00:48 +00:00
method.go
npn_test.go
proxy_test.go
race.go
range_test.go
readrequest_test.go
request_test.go net/url: reject space in host; do not escape < > " in host 2015-12-11 05:17:38 +00:00
request.go net/http: fix validHeaderValue yet again, excluding the DEL CTL byte 2016-01-08 19:01:32 +00:00
requestwrite_test.go
response_test.go net/http: reject non three digit status codes in ReadResponse 2016-01-13 17:38:50 +00:00
response.go net/http: reject non three digit status codes in ReadResponse 2016-01-13 17:38:50 +00:00
responsewrite_test.go
serve_test.go net/http: fix flaky TestServerValidatesHostHeader 2016-01-14 15:23:41 +00:00
server.go net/http: clarify ConnState StateActive docs for HTTP/2 2016-01-13 22:11:37 +00:00
sniff_test.go net/http: run more tests in http2 mode 2015-12-10 04:43:08 +00:00
sniff.go net/http: add/update mp4 sniffing 2015-11-17 18:00:15 +00:00
status.go net/http: add new HTTP 451 status code, Unavailable For Legal Reasons. 2015-12-22 02:14:22 +00:00
transfer_test.go
transfer.go net/http: relax recently-updated rules and behavior of CloseNotifier 2016-01-05 04:39:11 +00:00
transport_test.go net/http: fix Transport crash when abandoning dial which upgrades protos 2016-01-13 17:52:50 +00:00
transport.go net/http: update bundled http2 2016-01-15 18:06:34 +00:00
triv.go