Skip to content

Commit

Permalink
reset arena after each send
Browse files Browse the repository at this point in the history
  • Loading branch information
mookums committed Sep 18, 2024
1 parent 3570e1e commit 266e844
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ pub fn Server(
if (inner.count >= inner.slice.len) {
// All done sending.
log.debug("{d} - queueing a new recv", .{p.index});
_ = p.arena.reset(.{
.retain_with_limit = z_config.size_connection_arena_retain,
});
p.recv_buffer.clearRetainingCapacity();
p.job = .{ .recv = .{ .count = 0 } };
try backend.queue_recv(p, p.socket, p.buffer);
Expand Down Expand Up @@ -560,6 +563,9 @@ pub fn Server(

if (inner.count >= inner.slice.len) {
log.debug("{d} - queueing a new recv", .{p.index});
_ = p.arena.reset(.{
.retain_with_limit = z_config.size_connection_arena_retain,
});
p.recv_buffer.clearRetainingCapacity();
p.job = .{ .recv = .{ .count = 0 } };
try backend.queue_recv(p, p.socket, p.buffer);
Expand Down

0 comments on commit 266e844

Please sign in to comment.