diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:51:07 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 09:54:56 -0300 |
| commit | 2ffc4abedcef7f077ebc7290b653415243da0975 (patch) | |
| tree | 8858b8ee8bd61234a305df359e9ef193f6085e29 /src/replica.zig | |
| parent | 617cdcc8999cefdfd785b80026805cef51d96b08 (diff) | |
| download | pardes-2ffc4abedcef7f077ebc7290b653415243da0975.tar.gz pardes-2ffc4abedcef7f077ebc7290b653415243da0975.zip | |
processes: small ones (main's version text from upgrade.version_line and waitForDel's unused io; daemon's find returns null with its words, drop takes the slot alone, send, recv, Got and setName are private; replica's Joining is the daemon's and PARDES_REPLICA_LAG_KB, which nothing sets, goes; host_io's dead line variable; Handover's own readdir is std.c's)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/replica.zig')
| -rw-r--r-- | src/replica.zig | 6 |
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; |
