diff options
author | Martin Ashby <martin@ashbysoft.com> | 2024-02-01 14:12:03 +0000 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2024-02-01 14:12:03 +0000 |
commit | c0b0b259a572bcc65dd2e6d55a126ead9c2ae6ff (patch) | |
tree | fa12113b6466c5dff14596a7b7bbdb34590ad6ff /src/main.zig | |
parent | a782c7083056558ccfe41ca42857a4680d55a9d9 (diff) | |
download | zigwebserver-c0b0b259a572bcc65dd2e6d55a126ead9c2ae6ff.tar.gz zigwebserver-c0b0b259a572bcc65dd2e6d55a126ead9c2ae6ff.tar.bz2 zigwebserver-c0b0b259a572bcc65dd2e6d55a126ead9c2ae6ff.tar.xz zigwebserver-c0b0b259a572bcc65dd2e6d55a126ead9c2ae6ff.zip |
Update for zig master
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig index 70869b2..11f6d0d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -39,7 +39,7 @@ const Handler = struct { fn serve_file(res: *std.http.Server.Response, file: std.fs.File, md: std.fs.File.Metadata) !void { res.transfer_encoding = .{ .content_length = md.size() }; - try res.do(); + try res.send(); var buf = [_]u8{0} ** 1024; while (true) { const read = try file.read(&buf); @@ -51,7 +51,7 @@ const Handler = struct { fn serve_error(res: *std.http.Server.Response, status: std.http.Status) !void { res.status = status; res.transfer_encoding = .chunked; - try res.do(); + try res.send(); const phrase = status.phrase() orelse "error!"; try std.fmt.format(res.writer(), \\ <!doctype html><html><body>{s}</body></html> |