]> jxnshi.xyz Git - jxnshi.xyz.git/commitdiff
Added disconnection log
authorjxnshi <jxnshi@cock.li>
Fri, 13 Dec 2024 20:20:37 +0000 (21:20 +0100)
committerjxnshi <jxnshi@cock.li>
Fri, 13 Dec 2024 20:20:37 +0000 (21:20 +0100)
src/main.zig

index 1cfba1e972a212169ac635e48d2c9c1add45def9..ca1c9bf7817b8e1cc078d05b0471867fccf54719 100644 (file)
@@ -169,11 +169,11 @@ fn handleClient(parent_allocator: std.mem.Allocator, connection: std.net.Server.
 
 fn handleClientThread(parent_allocator: std.mem.Allocator, connection: std.net.Server.Connection) void {
     handleClient(parent_allocator, connection) catch |err| {
-        switch (err) {
-            error.HttpConnectionClosing => std.log.info("Client {} disconnected.", .{connection.address}),
-            else => std.log.err("Client {} errored with code {}", .{ connection.address, err }),
-        }
+        std.log.err("Client {} errored with code {}", .{ connection.address, err });
+        return;
     };
+
+    std.log.info("Client {} disconnected.", .{connection.address});
 }
 
 pub fn main() !void {