]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document Response.Body Read+Close interaction with keep-alive
authorBrad Fitzpatrick <bradfitz@golang.org>
Sat, 13 Dec 2014 08:00:48 +0000 (19:00 +1100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 13 Dec 2014 10:18:18 +0000 (10:18 +0000)
Fixes #5645

Change-Id: Ifb46d6faf7ac838792920f6fe00912947478e761
Reviewed-on: https://go-review.googlesource.com/1531
Reviewed-by: David Symonds <dsymonds@golang.org>
src/net/http/response.go

index 5d2c39080e4b9176b10c69e8f50a27431107e494..cfe695ce5c1d15fafd75072893a42e2f005a11bd 100644 (file)
@@ -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.