-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
migrate std-docs.zig to std.Io #25785
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
base: master
Are you sure you want to change the base?
Conversation
b12de31 to
8b26295
Compare
Same problem as #24944. Presumably, |
970b1eb to
59e1ee6
Compare
| w.end = new_end; | ||
| return header.len + try w.vtable.sendFile(w, file_reader, limit); | ||
| return header.len + (w.vtable.sendFile(w, file_reader, limit) catch |err| { | ||
| w.end = old_end; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That change I'm not sure about myself...when the underlying writer returns error.Unimplemented we need to make sure w.end is in its original state so the writer above will re-send the header (because it does not know how much of it was written), but we need to write it before calling w.vtable.sendFile because it might flush. With this fix, the @memcopy call is wasted.
Another solution would be to follow through with sendFileReading but as the docstring of sendFile suggests, it may be less efficient than wasting the @memcopy once per file.
resolves #25770
possibly also #24944 if someone tests this on windows