diff options
| author | kcbanner <kcbanner@gmail.com> | 2025-10-08 03:49:13 -0400 |
|---|---|---|
| committer | kcbanner <kcbanner@gmail.com> | 2025-10-09 01:06:09 -0400 |
| commit | 8b6cdc3d8224cf1e97a970f78281db2fcd14b7a2 (patch) | |
| tree | 2b7c53bbec33d5c1d9edde483a51fc196ed602e6 /lib/std/Build/WebServer.zig | |
| parent | 447280d0d98b540aed4df83db7cf95a417d81611 (diff) | |
| download | zig-8b6cdc3d8224cf1e97a970f78281db2fcd14b7a2.tar.gz zig-8b6cdc3d8224cf1e97a970f78281db2fcd14b7a2.zip | |
- Rework common translate-c and cImport logic into `Compilation.translateC`
- Add std.zig.Server.allocErrorBundle, replace duplicates
Diffstat (limited to 'lib/std/Build/WebServer.zig')
| -rw-r--r-- | lib/std/Build/WebServer.zig | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/std/Build/WebServer.zig b/lib/std/Build/WebServer.zig index 8f91a8580d..f05d8490d3 100644 --- a/lib/std/Build/WebServer.zig +++ b/lib/std/Build/WebServer.zig @@ -595,19 +595,7 @@ fn buildClientWasm(ws: *WebServer, arena: Allocator, optimize: std.builtin.Optim } }, .error_bundle => { - const EbHdr = std.zig.Server.Message.ErrorBundle; - const eb_hdr = @as(*align(1) const EbHdr, @ptrCast(body)); - const extra_bytes = - body[@sizeOf(EbHdr)..][0 .. @sizeOf(u32) * eb_hdr.extra_len]; - const string_bytes = - body[@sizeOf(EbHdr) + extra_bytes.len ..][0..eb_hdr.string_bytes_len]; - const unaligned_extra: []align(1) const u32 = @ptrCast(extra_bytes); - const extra_array = try arena.alloc(u32, unaligned_extra.len); - @memcpy(extra_array, unaligned_extra); - result_error_bundle = .{ - .string_bytes = try arena.dupe(u8, string_bytes), - .extra = extra_array, - }; + result_error_bundle = try std.zig.Server.allocErrorBundle(arena, body); }, .emit_digest => { const EmitDigest = std.zig.Server.Message.EmitDigest; |
