TUN-6035: Reduce buffer size when proxying data

This commit is contained in:
João Oliveirinha
2022-04-11 11:44:42 +01:00
parent 0dc3428424
commit d1a4710aa2
2 changed files with 30 additions and 1 deletions

View File

@@ -15,6 +15,8 @@ import (
"github.com/getsentry/raven-go"
"github.com/gorilla/websocket"
"github.com/rs/zerolog"
"github.com/cloudflare/cloudflared/cfio"
)
// IsWebSocketUpgrade checks to see if the request is a WebSocket connection.
@@ -146,7 +148,7 @@ func copyData(dst io.Writer, src io.Reader, dir string) (written int64, err erro
}
return copyBuffer(dst, src, dir)
} else {
return io.Copy(dst, src)
return cfio.Copy(dst, src)
}
}