]> Cypherpunks repositories - gostls13.git/commit
internal/poll: specify current file position when calling TransmitFile
authorAlex Brainman <alex.brainman@gmail.com>
Mon, 11 Jun 2018 02:09:18 +0000 (12:09 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 14 Jun 2018 09:42:03 +0000 (09:42 +0000)
commitaf4d60428f6dc5eab10b6de23235f61cceee8bc3
treedccaa0545e93626f92df564f66e93231fcfb3cc3
parent7bab1ee5e0be7955e298eb956b7ddc921803e84f
internal/poll: specify current file position when calling TransmitFile

Current SendFile implementation assumes that TransmitFile starts from
the current file position. But that appears not true for Windows 10
Version 1803.

TransmitFile documentation

https://msdn.microsoft.com/en-us/library/windows/desktop/ms740565(v=vs.85).aspx

suggests, "You can use the lpOverlapped parameter to specify a 64-bit
offset within the file at which to start the file data transfer by
setting the Offset and OffsetHigh member of the OVERLAPPED structure."

Do as it advises.

Fixes #25722

Change-Id: I241d3bf76d0d5590d4df27c6f922d637068232fb
Reviewed-on: https://go-review.googlesource.com/117816
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/internal/poll/sendfile_windows.go