diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2014-12-13 19:00:48 +1100 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2014-12-13 10:18:18 +0000 |
commit | 8476d4cf2937fc261bbcf2890ba39d815bce3ae5 (patch) | |
tree | 5bae971d1f9973702df6fecf0d5419d4139c319d | |
parent | 0e4ee0c9bfc8d4048fd49a1061080a92c0dc0804 (diff) | |
download | go-git-8476d4cf2937fc261bbcf2890ba39d815bce3ae5.tar.gz |
net/http: document Response.Body Read+Close interaction with keep-alive
Fixes #5645
Change-Id: Ifb46d6faf7ac838792920f6fe00912947478e761
Reviewed-on: https://go-review.googlesource.com/1531
Reviewed-by: David Symonds <dsymonds@golang.org>
-rw-r--r-- | src/net/http/response.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net/http/response.go b/src/net/http/response.go index 5d2c39080e..cfe695ce5c 100644 --- a/src/net/http/response.go +++ b/src/net/http/response.go @@ -48,7 +48,10 @@ 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. + // 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. // // The Body is automatically dechunked if the server replied // with a "chunked" Transfer-Encoding. |