mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
Drain response body properly for http connection pool (#6415)
Currently Go http connection pool was not being properly utilized leading to degrading performance as the number of concurrent requests increased. As recommended by Go implementation, we have to drain the response body and close it.
This commit is contained in:
@@ -324,7 +324,7 @@ func downloadReleaseURL(releaseChecksumURL string, timeout time.Duration, mode s
|
||||
if resp == nil {
|
||||
return content, fmt.Errorf("No response from server to download URL %s", releaseChecksumURL)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer CloseResponse(resp.Body)
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return content, fmt.Errorf("Error downloading URL %s. Response: %v", releaseChecksumURL, resp.Status)
|
||||
@@ -471,7 +471,7 @@ func doUpdate(sha256Hex string, latestReleaseTime time.Time, ok bool) (updateSta
|
||||
if err != nil {
|
||||
return updateStatusMsg, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
defer CloseResponse(resp.Body)
|
||||
|
||||
// FIXME: add support for gpg verification as well.
|
||||
if err = update.Apply(resp.Body,
|
||||
|
||||
Reference in New Issue
Block a user