Merge pull request #1298 from krishnasrinivas/use-single-connection
Fix to use single connection to the server
This commit is contained in:
+8
@@ -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()
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user