mirror of
https://git.robbyzambito.me/zits
synced 2026-02-04 11:44:48 +00:00
More cleanup
This commit is contained in:
@@ -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});
|
||||
|
||||
Reference in New Issue
Block a user