From 3639929d7b08eabb36c380444c80f54c9f7a4cee Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 4 Jan 2018 23:06:31 +0000 Subject: [PATCH] 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 --- src/net/http/response.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/net/http/response.go b/src/net/http/response.go index 4c614bfab0b..a91efcffbac 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.