allocate body buffer once
This commit is contained in:
parent
9ecb498fd4
commit
4340479d8c
2
utils.go
2
utils.go
|
@ -128,8 +128,8 @@ func flush(flusher interface{}) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyBody(wr io.Writer, body io.Reader) {
|
func copyBody(wr io.Writer, body io.Reader) {
|
||||||
for {
|
|
||||||
buf := make([]byte, COPY_BUF)
|
buf := make([]byte, COPY_BUF)
|
||||||
|
for {
|
||||||
bread, read_err := body.Read(buf)
|
bread, read_err := body.Read(buf)
|
||||||
var write_err error
|
var write_err error
|
||||||
if bread > 0 {
|
if bread > 0 {
|
||||||
|
|
Loading…
Reference in New Issue