summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2024-02-01 14:12:03 +0000
committerMartin Ashby <martin@ashbysoft.com>2024-02-01 14:12:03 +0000
commitc0b0b259a572bcc65dd2e6d55a126ead9c2ae6ff (patch)
treefa12113b6466c5dff14596a7b7bbdb34590ad6ff /src/main.zig
parenta782c7083056558ccfe41ca42857a4680d55a9d9 (diff)
downloadzigwebserver-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.zig4
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>