allocate body buffer once

This commit is contained in:
Vladislav Yarmak 2020-05-28 23:54:07 +03:00
parent 9ecb498fd4
commit 4340479d8c
1 changed files with 1 additions and 1 deletions

View File

@ -128,8 +128,8 @@ func flush(flusher interface{}) bool {
}
func copyBody(wr io.Writer, body io.Reader) {
buf := make([]byte, COPY_BUF)
for {
buf := make([]byte, COPY_BUF)
bread, read_err := body.Read(buf)
var write_err error
if bread > 0 {