]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.23] internal/poll: keep copying after successful Sendfile return...
authorDamien Neil <dneil@google.com>
Wed, 23 Oct 2024 23:01:08 +0000 (16:01 -0700)
committerMichael Pratt <mpratt@google.com>
Wed, 30 Oct 2024 17:03:55 +0000 (17:03 +0000)
commit6ba3a8a6ba5214ec88b83e39148de8cd540a6e94
tree2f26338b725d6eb63fc4f93609948a16989c545b
parent5472853843bd9ae72ddc107a556558d13e39b035
[release-branch.go1.23] internal/poll: keep copying after successful Sendfile return on BSD

The BSD implementation of poll.SendFile incorrectly halted
copying after succesfully writing one full chunk of data.
Adjust the copy loop to match the Linux and Solaris
implementations.

In testing, empirically macOS appears to sometimes return
EAGAIN from sendfile after successfully copying a full
chunk. Add a check to all implementations to return nil
after successfully copying all data if the last sendfile
call returns EAGAIN.

For #70000
For #70020

Change-Id: I57ba649491fc078c7330310b23e1cfd85135c8ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/622235
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
(cherry picked from commit bd388c0216bcb33d7325b0ad9722a3be8155a289)
Reviewed-on: https://go-review.googlesource.com/c/go/+/622696
src/internal/poll/sendfile_bsd.go
src/internal/poll/sendfile_linux.go
src/internal/poll/sendfile_solaris.go
src/os/copy_test.go [new file with mode: 0644]
src/os/readfrom_linux_test.go