More cleanup

This commit is contained in:
2025-12-29 04:56:48 +00:00
parent b9d0672971
commit fe4c1d410b
2 changed files with 2 additions and 16 deletions

View File

@@ -86,7 +86,7 @@ fn handleConnection(
}
const allocator = client_allocator.allocator();
defer stream.close(io);
var w_buffer: [1024]u8 = undefined;
var w_buffer: [4096]u8 = undefined;
var writer = stream.writer(io, &w_buffer);
const out = &writer.interface;
@@ -107,7 +107,6 @@ fn handleConnection(
defer server.removeClient(allocator, id);
while (client_state.next(allocator)) |msg| {
std.debug.print("message from client: {any}\n", .{msg});
switch (msg) {
.ping => {
// Respond to ping with pong.
@@ -118,13 +117,9 @@ fn handleConnection(
} else {}
},
.@"pub" => |@"pub"| {
std.debug.print("pub: {any}\n", .{@"pub"});
try server.publishMessage(io, @"pub");
if (client_state.connect.connect.verbose) {
std.debug.print("server IS sending +ok\n", .{});
_ = try client_state.send(io, .@"+ok");
} else {
std.debug.print("server NOT sending +ok\n", .{});
}
},
.sub => |sub| {
@@ -137,9 +132,6 @@ fn handleConnection(
std.debug.panic("Unimplemented message: {any}\n", .{e});
},
}
std.debug.print("processed message from client\n", .{});
std.debug.print("awaiting next message from client\n", .{});
} else |err| {
// This is probably going to be normal on disconnect
std.debug.print("Ran into error in client process loop: {}\n", .{err});