]> Cypherpunks repositories - gostls13.git/commit
internal/poll: remove buf field from operation
authorqmuntal <quimmuntal@gmail.com>
Tue, 16 Sep 2025 08:25:58 +0000 (10:25 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 29 Sep 2025 19:26:28 +0000 (12:26 -0700)
commit690fc2fb05e720850a474c72bf3a8a9a6638cef7
tree7da975c45c1326b06169670901f2eb16ecc48518
parenteaf2345256613dfbda7e8e69e5f845c4209246c6
internal/poll: remove buf field from operation

WSASend and WSARecv functions capture the WSABuf structure before
returning, so there is no need to keep a copy of it in the
operation structure.

Write and Read functions don't need it, they can operate directly
on the byte slice.

To be on the safe side, pin the input byte slice so that stack-allocated
slices don't get moved while overlapped I/O is in progress.

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race
Change-Id: I474bed94e11acafa0bdd8392b5dcf8993d8e1ed5
Reviewed-on: https://go-review.googlesource.com/c/go/+/704155
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/internal/poll/fd_windows.go
src/net/tcpsock_test.go