summaryrefslogtreecommitdiff
path: root/src/replica.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/replica.zig')
-rw-r--r--src/replica.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/replica.zig b/src/replica.zig
index 990efb9b..16ecc184 100644
--- a/src/replica.zig
+++ b/src/replica.zig
@@ -1215,8 +1215,7 @@ const log = std.log.scoped(.replica);
const nosignal: u32 = if (builtin.os.tag == .linux) libc.MSG.NOSIGNAL else 0;
/// What a client may leave unread, past its join's dump, before it is cut
/// off: minutes of typing, a screenful of a flood's deltas many times over.
-/// PARDES_REPLICA_LAG_KB says another (a test's).
-var lag_max: usize = 64 << 20;
+const lag_max: usize = 64 << 20;
const dump_piece = 1 << 20;
/// A blob in a far join's list (wire.zig `blobs`): its place in the state
/// (u64le), its length (u64le) and its BLAKE3 hash.
@@ -1763,7 +1762,7 @@ pub const Peers = struct {
pub const Note = union(enum) { join: Joining, input: Msg, screen: Msg, gone: *Peer, check: *Peer, joined: *Peer, hashed };
/// A connection to join, and the view it joins again for, if it does.
- pub const Joining = struct { fd: c_int, view: ?u8 = null };
+ pub const Joining = @import("daemon.zig").Joining;
pub const Msg = struct { peer: *Peer, msg: []u8 };
pub fn count(ps: *const Peers) usize {
@@ -2022,7 +2021,6 @@ pub const Peers = struct {
core.gpa.free(bytes);
return refuse(fd, "out of memory");
};
- if (std.c.getenv("PARDES_REPLICA_LAG_KB")) |kb| lag_max = (std.fmt.parseInt(usize, std.mem.span(kb), 10) catch 64 << 10) << 10;
peer.* = .{ .peers = ps, .fd = fd, .id = ps.next_id, .view = k, .limit = lag_max, .dump = bytes, .blobs = blobs, .dump_gpa = core.gpa };
ps.next_id +%= 1;
if (ps.next_id == 0) ps.next_id = 1;