Skip to content

Conversation

@dasimmet
Copy link
Contributor

@dasimmet dasimmet commented Nov 1, 2025

resolves #25770
possibly also #24944 if someone tests this on windows

@dasimmet dasimmet force-pushed the fix/std-docs branch 2 times, most recently from b12de31 to 8b26295 Compare November 1, 2025 23:19
@squeek502
Copy link
Member

squeek502 commented Nov 1, 2025

it fails to write the chunked http encoding when serving the sources inside a tar

Same problem as #24944. Presumably, sendFile is returning error.Unimplemented, and http isn't handling that fully correctly yet. Previously, that was only happening on Windows.

@dasimmet dasimmet marked this pull request as ready for review November 3, 2025 07:58
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;
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zig std broke on latest master due to removed std.net.Address

3 participants