Fix to use single connection to the server

This commit is contained in:
Krishna Srinivas
2015-11-13 19:55:26 -08:00
parent e8e2d4a6c4
commit 2ea16262e0
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -41,7 +41,15 @@ type s3API struct {
// closeResp close non nil response with any response Body.
func closeResp(resp *http.Response) {
// Callers should close resp.Body when done reading from it.
// If resp.Body is not closed, the Client's underlying RoundTripper
// (typically Transport) may not be able to re-use a persistent TCP
// connection to the server for a subsequent "keep-alive" request.
if resp != nil && resp.Body != nil {
// Drain any remaining Body and then close the connection.
// Without this closing connection would disallow re-using
// the same connection for future uses.
// - http://stackoverflow.com/a/17961593/4465767
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
}
+2 -2
View File
@@ -29,8 +29,8 @@
},
{
"path": "github.com/minio/minio-go",
"revision": "8d76e3db295dbc5e46697f75907c8eedfa50cce3",
"revisionTime": "2015-11-13T19:31:33-08:00"
"revision": "5eb302c71339c00f6a895f2dca133395227c0fae",
"revisionTime": "2015-11-13T19:53:11-08:00"
},
{
"path": "github.com/minio/minio-xl/pkg/probe",