diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-08-16 16:24:11 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-16 16:24:11 -0700 |
| commit | 623290ea9b23780303e18f200fb0e4ca1861cf57 (patch) | |
| tree | acc22088dfed1591332374afcd0f7315310881b0 /lib/std/http | |
| parent | 551e009da7be279293fe261b729280d29fcf81b0 (diff) | |
| parent | 0cfd07bc865efa4b74d32b16b7dfd1a68167ce14 (diff) | |
| download | zig-623290ea9b23780303e18f200fb0e4ca1861cf57.tar.gz zig-623290ea9b23780303e18f200fb0e4ca1861cf57.zip | |
Merge pull request #24864 from ifreund/fix-std-cmd
http.BodyWriter: handle EOF in chunkedSendFile, simplify
Diffstat (limited to 'lib/std/http')
| -rw-r--r-- | lib/std/http/Client.zig | 2 | ||||
| -rw-r--r-- | lib/std/http/Server.zig | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig index f052943816..626036234c 100644 --- a/lib/std/http/Client.zig +++ b/lib/std/http/Client.zig @@ -912,7 +912,7 @@ pub const Request = struct { return switch (r.transfer_encoding) { .chunked => .{ .http_protocol_output = http_protocol_output, - .state = .{ .chunked = .init }, + .state = .init_chunked, .writer = .{ .buffer = buffer, .vtable = &.{ diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig index c62906827a..b64253f975 100644 --- a/lib/std/http/Server.zig +++ b/lib/std/http/Server.zig @@ -450,11 +450,11 @@ pub const Request = struct { try out.writeAll("\r\n"); const elide_body = request.head.method == .HEAD; const state: http.BodyWriter.State = if (o.transfer_encoding) |te| switch (te) { - .chunked => .{ .chunked = .init }, + .chunked => .init_chunked, .none => .none, } else if (options.content_length) |len| .{ .content_length = len, - } else .{ .chunked = .init }; + } else .init_chunked; return if (elide_body) .{ .http_protocol_output = request.server.out, @@ -480,7 +480,7 @@ pub const Request = struct { .drain = http.BodyWriter.contentLengthDrain, .sendFile = http.BodyWriter.contentLengthSendFile, }, - .chunked => &.{ + .chunk_len => &.{ .drain = http.BodyWriter.chunkedDrain, .sendFile = http.BodyWriter.chunkedSendFile, }, |
