summaryrefslogtreecommitdiff
path: root/src/Server/Client.zig
diff options
context:
space:
mode:
authorRobby Zambito <contact@robbyzambito.me>2026-01-08 11:48:12 -0500
committerRobby Zambito <contact@robbyzambito.me>2026-01-08 16:47:52 -0500
commitd8488fde4902565f4ac8519565f234918dab6b11 (patch)
treeb50e523a32f4ccab4c5ec093a5dce24250f5b7b8 /src/Server/Client.zig
parent45feccbad8c7306c15137a6003f3df1183d9c2a9 (diff)
support hpub
fixed issue where not all data was being sent request reply has a performance issue but technically works
Diffstat (limited to 'src/Server/Client.zig')
-rw-r--r--src/Server/Client.zig68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/Server/Client.zig b/src/Server/Client.zig
index a7dd007..26be79f 100644
--- a/src/Server/Client.zig
+++ b/src/Server/Client.zig
@@ -6,11 +6,6 @@ const Queue = std.Io.Queue;
const Client = @This();
-pub const Msgs = union(enum) {
- MSG: Message.Msg,
- HMSG: Message.HMsg,
-};
-
connect: ?Message.Connect,
// Byte queue for this client to receive.
recv_queue: *Queue(u8),
@@ -48,69 +43,6 @@ pub fn start(self: *Client, io: std.Io) !void {
self.to_client.end = try self.recv_queue.get(io, self.to_client.buffer, 1);
try self.to_client.flush();
}
- // while (true) {
- // switch (try io.select(.{ .msgs = &recv_msgs_task, .proto = &recv_proto_task })) {
- // .msgs => |len_err| {
- // @branchHint(.likely);
- // const msgs = msgs_buf[0..try len_err];
- // for (0..msgs.len) |i| {
- // const msg = msgs[i];
- // defer switch (msg) {
- // .MSG => |m| m.deinit(self.alloc),
- // .HMSG => |h| h.deinit(self.alloc),
- // };
- // errdefer for (msgs[i + 1 ..]) |mg| switch (mg) {
- // .MSG => |m| {
- // m.deinit(self.alloc);
- // },
- // .HMSG => |h| {
- // h.deinit(self.alloc);
- // },
- // };
- // switch (msg) {
- // .MSG => |m| {
-
- // },
- // .HMSG => |hmsg| {
- // try self.to_client.print("HMSG {s} {s} {s} {d} {d}\r\n", .{
- // hmsg.msg.subject,
- // hmsg.msg.sid,
- // hmsg.msg.reply_to orelse "",
- // hmsg.header_bytes,
- // hmsg.msg.payload.len,
- // });
- // try hmsg.msg.payload.write(self.to_client);
- // try self.to_client.print("\r\n", .{});
- // },
- // }
- // }
- // recv_msgs_task = io.concurrent(Queue(Msgs).get, .{ self.msg_queue, io, &msgs_buf, 1 }) catch unreachable;
- // },
- // .proto => |msg_err| {
- // @branchHint(.unlikely);
- // const msg = try msg_err;
- // switch (msg) {
- // .@"+OK" => {
- // _ = try self.to_client.write("+OK\r\n");
- // },
- // .PONG => {
- // _ = try self.to_client.write("PONG\r\n");
- // },
- // .INFO => |info| {
-
- // },
- // .@"-ERR" => |s| {
- // _ = try self.to_client.print("-ERR '{s}'\r\n", .{s});
- // },
- // else => |m| {
- // std.debug.panic("unimplemented write: {any}\n", .{m});
- // },
- // }
- // recv_proto_task = io.concurrent(Queue(Message).getOne, .{ self.recv_queue, io }) catch unreachable;
- // },
- // }
- // try self.to_client.flush();
- // }
}
pub fn send(self: *Client, io: std.Io, msg: []const u8) !void {