New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: no way to use sendfile with offset and count #9113
Labels
Comments
That doesn't currently work either, because an io.LimitedReader isn't an *io.File, and fails the type assertion in sendfile_linux.go. It would be nice if that worked too. Using Seek though still doesn't quite cover the sendfile api. If you call sendfile with an offset, it does not modify the current file offset. |
We're not trying to cover the sendfile API. We're trying to make it possible to write meaningful portable code that uses the sendfile optimization automatically. And we have. ReadFrom changes the file offset. You can't avoid that and still have ReadFrom. So if you really can't modify the file offset you're asking us to introduce a completely different way to get to sendfile on top of what's already there. And I'd really rather not. It's easy to open a file multiple times. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: