diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2018-01-04 23:06:31 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-01-05 00:36:20 +0000 |
commit | 3639929d7b08eabb36c380444c80f54c9f7a4cee (patch) | |
tree | bb2edf7e51848c9c74f9bb1ff225d867e275eeb8 | |
parent | a6b938549e5e0ff33c77a5bbba797a1a6f7f9401 (diff) | |
download | go-3639929d7b08eabb36c380444c80f54c9f7a4cee.tar.gz go-3639929d7b08eabb36c380444c80f54c9f7a4cee.zip |
net/http: soften wording around when the Transport reuses connections
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>
-rw-r--r-- | src/net/http/response.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/net/http/response.go b/src/net/http/response.go index 4c614bfab0..a91efcffba 100644 --- a/src/net/http/response.go +++ b/src/net/http/response.go @@ -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. |