From c0b0b259a572bcc65dd2e6d55a126ead9c2ae6ff Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Thu, 1 Feb 2024 14:12:03 +0000 Subject: Update for zig master --- src/zigwebserver.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/zigwebserver.zig') diff --git a/src/zigwebserver.zig b/src/zigwebserver.zig index acf65fb..64bd649 100644 --- a/src/zigwebserver.zig +++ b/src/zigwebserver.zig @@ -19,7 +19,7 @@ pub fn Server(comptime Context: type, comptime Handler: type) type { try tp.init(.{ .allocator = self.allocator, .n_jobs = self.n_threads }); defer tp.deinit(); - var svr_internal = std.http.Server.init(self.allocator, .{ .reuse_address = true }); + var svr_internal = std.http.Server.init(.{ .reuse_address = true }); defer svr_internal.deinit(); try svr_internal.listen(self.address); std.log.info("server listening on {}", .{self.address}); @@ -57,7 +57,7 @@ pub fn Server(comptime Context: type, comptime Handler: type) type { res.status = status; res.transfer_encoding = .{ .content_length = content.len }; try res.headers.append("content-type", "text/html"); - try res.do(); + try res.send(); try res.writer().writeAll(content); try res.finish(); } @@ -185,7 +185,7 @@ const RouterTest = struct { .method = .GET, .target = target, }; - var res = TestResponse{ + const res = TestResponse{ .request = req, }; const router = TestRouter{ @@ -225,8 +225,8 @@ const RouterTest = struct { var it = pexp.keyIterator(); var kexp = it.next(); while (kexp != null) : (kexp = it.next()) { - var vexp = pexp.get(kexp.?.*).?; - var maybe_vact = pact.get(kexp.?.*); + const vexp = pexp.get(kexp.?.*).?; + const maybe_vact = pact.get(kexp.?.*); if (maybe_vact) |vact| { std.debug.print("{s} {s}", .{ vexp, vact }); try std.testing.expectEqual(vexp, vact); -- cgit v1.2.3-ZIG