-
-
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?
Changes from all commits
a0990b1
2633bce
eb2de20
59e1ee6
d9baf97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -911,11 +911,15 @@ pub fn sendFileHeader( | |
| file_reader: *File.Reader, | ||
| limit: Limit, | ||
| ) FileError!usize { | ||
| const new_end = w.end + header.len; | ||
| const old_end = w.end; | ||
| const new_end = old_end + header.len; | ||
| if (new_end <= w.buffer.len) { | ||
| @memcpy(w.buffer[w.end..][0..header.len], header); | ||
| 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; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| return err; | ||
| }); | ||
| } | ||
| const buffered_contents = limit.slice(file_reader.interface.buffered()); | ||
| const n = try w.vtable.drain(w, &.{ header, buffered_contents }, 1); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.