]> Cypherpunks repositories - gostls13.git/commit
net: fix sendfile regression with io.Copy on macOS
authorPhilipp Wollermann <philwo@google.com>
Tue, 23 Apr 2024 08:18:20 +0000 (17:18 +0900)
committerDamien Neil <dneil@google.com>
Fri, 26 Apr 2024 17:08:30 +0000 (17:08 +0000)
commit196916299da7568a2a2165246e5164637df03fb9
treecfe0639f70af648cd34f2f07502f388d15f4efab
parentdeeebf5655eeb91e93e60dbda5c3df294b4d5130
net: fix sendfile regression with io.Copy on macOS

Since CL 472475, io.Copy can no longer use sendfile on macOS for copying
files to a socket due to a too strict type assertion. This CL fixes the
issue by checking for the necessary interfaces instead of the concrete
os.File type in sendfile_unix_alt.go.

Fixes #66988

Change-Id: Ia0dd190f6575016a191c34a935132907147c8e10
Reviewed-on: https://go-review.googlesource.com/c/go/+/581035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/sendfile_unix_alt.go