mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
remove unnecessary buffer while discarding stream (#7214)
This commit is contained in:
parent
18c4ecbbef
commit
c1b3f1994b
@ -44,9 +44,7 @@ func DrainBody(respBody io.ReadCloser) {
|
|||||||
// Without this closing connection would disallow re-using
|
// Without this closing connection would disallow re-using
|
||||||
// the same connection for future uses.
|
// the same connection for future uses.
|
||||||
// - http://stackoverflow.com/a/17961593/4465767
|
// - http://stackoverflow.com/a/17961593/4465767
|
||||||
bufp := b512pool.Get().(*[]byte)
|
defer respBody.Close()
|
||||||
defer b512pool.Put(bufp)
|
io.Copy(ioutil.Discard, respBody)
|
||||||
io.CopyBuffer(ioutil.Discard, respBody, *bufp)
|
|
||||||
respBody.Close()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user