cdp: increase msg size 16KB -> 256KB

And move header size encoding from 2 bytes -> 2 bytes

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-12-04 22:54:21 +01:00
parent c9ca170d57
commit 913d3af938
2 changed files with 19 additions and 16 deletions

View File

@@ -49,7 +49,7 @@ pub const Stream = struct {
}
fn closeCDP(self: *const Stream) void {
const close_msg: []const u8 = .{ 5, 0 } ++ "close";
const close_msg: []const u8 = .{ 5, 0, 0, 0 } ++ "close";
self.recv(close_msg) catch |err| {
log.err("stream close error: {any}", .{err});
};
@@ -87,7 +87,7 @@ pub const Handler = struct {
}
pub fn clientMessage(self: *Handler, data: []const u8) !void {
var header: [2]u8 = undefined;
var header: [4]u8 = undefined;
Msg.setSize(data.len, &header);
try self.stream.recv(&header);
try self.stream.recv(data);