remove unnecessary buffer while discarding stream (#7214)

master
Sidhartha Mani 6 years ago committed by Harshavardhana
parent 18c4ecbbef
commit c1b3f1994b
  1. 6
      cmd/http/close.go

@ -44,9 +44,7 @@ func DrainBody(respBody io.ReadCloser) {
// Without this closing connection would disallow re-using
// the same connection for future uses.
// - http://stackoverflow.com/a/17961593/4465767
bufp := b512pool.Get().(*[]byte)
defer b512pool.Put(bufp)
io.CopyBuffer(ioutil.Discard, respBody, *bufp)
respBody.Close()
defer respBody.Close()
io.Copy(ioutil.Discard, respBody)
}
}

Loading…
Cancel
Save