Skip to content

Commit bba0bd6

Browse files
committed
std.http.BodyWriter.chunkedSendFile: continue with a new chunk if called at chunk end
1 parent 6fa655a commit bba0bd6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/std/http.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,11 @@ pub const BodyWriter = struct {
975975
2 => {
976976
try out.writeAll("\r\n");
977977
bw.state.chunk_len = 0;
978-
assert(file_reader.atEnd());
979-
return error.EndOfStream;
978+
if (file_reader.atEnd()) {
979+
return error.EndOfStream;
980+
} else {
981+
continue :l bw.state.chunk_len;
982+
}
980983
},
981984
else => {
982985
const chunk_limit: std.Io.Limit = .limited(bw.state.chunk_len - 2);

0 commit comments

Comments
 (0)