mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
vfs/splice: limit a size of an intermediate buffer to pipe.DefaultPipeSize
This commit is contained in:
committed by
Andrei Vagin
parent
eeeaa63923
commit
b660830fe8
@@ -380,7 +380,11 @@ func Sendfile(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysc
|
||||
}
|
||||
} else {
|
||||
// Read inFile to buffer, then write the contents to outFile.
|
||||
buf := make([]byte, count)
|
||||
bufSize := count
|
||||
if count > pipe.DefaultPipeSize {
|
||||
bufSize = count
|
||||
}
|
||||
buf := make([]byte, bufSize)
|
||||
for {
|
||||
var readN int64
|
||||
if offset != -1 {
|
||||
|
||||
Reference in New Issue
Block a user