]> Cypherpunks repositories - gostls13.git/commit
net: reenable sendfile on Windows
authorqmuntal <quimmuntal@gmail.com>
Wed, 9 Apr 2025 09:15:38 +0000 (11:15 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Thu, 10 Apr 2025 14:36:41 +0000 (07:36 -0700)
commit9aad012a6e02d45b37757faeec20cc6923610baf
tree7aa2c0aab660a60d954725d2cbf9cb7174c82b7f
parentd60a684c87104ed7836403eab74eb2be1e4a97cb
net: reenable sendfile on Windows

Windows sendfile optimization is skipped since CL 472475, which started
passing an os.fileWithoutWriteTo instead of an os.File to sendfile,
and that function was only implemented for os.File.

This CL fixes the issue by asserting against an interface rather than
a concrete type.

Some tests have been reenabled, triggering bugs in poll.SendFile which
have been fixed in this CL.

Fixes #67042.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest
Change-Id: Id6f7a0e1e0f34a72216fa9d00c5bf36f5a994219
Reviewed-on: https://go-review.googlesource.com/c/go/+/664055
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/internal/poll/sendfile_windows.go
src/net/sendfile_test.go
src/net/sendfile_windows.go