]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: soften wording around when the Transport reuses connections
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 4 Jan 2018 23:06:31 +0000 (23:06 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 5 Jan 2018 00:36:20 +0000 (00:36 +0000)
The docs were too specific. Make it vaguer. There are conditions for
which the Transport will try to reuse a connection anyway, even if the
Response Body isn't read to EOF or closed, but we don't need to get
into all the details in the docs.

Fixes #22954

Change-Id: I3b8ae32aeb1a61b396d0026e129552afbfecceec
Reviewed-on: https://go-review.googlesource.com/86276
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/response.go

index 4c614bfab0b55ab90ab5ee9079283d279e7d3f1f..a91efcffbac6e32ef5c7deeece69d14644f1ba31 100644 (file)
@@ -57,10 +57,9 @@ type Response struct {
        // The http Client and Transport guarantee that Body is always
        // non-nil, even on responses without a body or responses with
        // a zero-length body. It is the caller's responsibility to
-       // close Body. The default HTTP client's Transport does not
-       // attempt to reuse HTTP/1.0 or HTTP/1.1 TCP connections
-       // ("keep-alive") unless the Body is read to completion and is
-       // closed.
+       // close Body. The default HTTP client's Transport may not
+       // reuse HTTP/1.x "keep-alive" TCP connections if the Body is
+       // not read to completion and closed.
        //
        // The Body is automatically dechunked if the server replied
        // with a "chunked" Transfer-Encoding.