From 5ce1819ccab65ceefa3198bbc78fb4dcac3cca6e Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Mon, 10 Jun 2019 13:44:56 -0400 Subject: [PATCH] doc, net/http: add release notes for net/http and fix doc comments Change-Id: I684e3522e387b2d96d5cfb2878d2f77bf4558443 Reviewed-on: https://go-review.googlesource.com/c/go/+/181545 Reviewed-by: Bryan C. Mills --- doc/go1.13.html | 18 +++++++++++++----- src/net/http/server.go | 2 +- src/net/http/transport.go | 5 +++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/go1.13.html b/doc/go1.13.html index ef4e0123e6214..5caae1315d229 100644 --- a/doc/go1.13.html +++ b/doc/go1.13.html @@ -220,23 +220,31 @@

Minor changes to the library

net/http

- TODO: https://golang.org/cl/130256: introduce DialerAndTLSConfigSupportsHTTP2 in Transport + The new field Transport.ForceAttemptHTTP2 + controls whether HTTP/2 is enabled when a non-zero Dial, DialTLS, or DialContext + func or TLSClientConfig is provided.

- TODO: https://golang.org/cl/140357: make Transport.MaxConnsPerHost work for HTTP/2 + When reusing HTTP/2, the Transport no longer performs unnecessary TLS handshakes.

- TODO: https://golang.org/cl/154383: make TimeoutHandler's ResponseWriter implement Pusher + TimeoutHandler's + ResponseWriter now implements the + Pusher and Flusher interfaces.

- TODO: https://golang.org/cl/167681: add Server BaseContext & ConnContext fields to control early context + The new Server fields + BaseContext and + ConnContext + allow finer control over the Context values provided to requests and connections.

- TODO: https://golang.org/cl/173658: export Header.Clone, reduce its allocations, use it everywhere + The new Header method + Clone returns a copy of the receiver.

diff --git a/src/net/http/server.go b/src/net/http/server.go index 829bacfa83335..e732378635830 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -2565,7 +2565,7 @@ type Server struct { BaseContext func(net.Listener) context.Context // ConnContext optionally specifies a function that modifies - // the context used for a newly connection c. The provided ctx + // the context used for a new connection c. The provided ctx // is derived from the base context and has a ServerContextKey // value. ConnContext func(ctx context.Context, c net.Conn) context.Context diff --git a/src/net/http/transport.go b/src/net/http/transport.go index a3f674ca5c46a..26f642aa7a02b 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -271,8 +271,9 @@ type Transport struct { tlsNextProtoWasNil bool // whether TLSNextProto was nil when the Once fired // ForceAttemptHTTP2 controls whether HTTP/2 is enabled when a non-zero - // TLSClientConfig or Dial, DialTLS or DialContext func is provided. By default, use of any those fields conservatively - // disables HTTP/2. To use a customer dialer or TLS config and still attempt HTTP/2 + // Dial, DialTLS, or DialContext func or TLSClientConfig is provided. + // By default, use of any those fields conservatively disables HTTP/2. + // To use a custom dialer or TLS config and still attempt HTTP/2 // upgrades, set this to true. ForceAttemptHTTP2 bool }