diff options
Diffstat (limited to 'src/replica.zig')
| -rw-r--r-- | src/replica.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/replica.zig b/src/replica.zig index e5dbe310..c5e3fd34 100644 --- a/src/replica.zig +++ b/src/replica.zig @@ -446,7 +446,10 @@ pub const Screens = struct { try writeScreenHead(&x.s.out, x.s.gpa, @intCast(id), pane.serial, kind_shadow); var w: std.Io.Writer.Allocating = .fromArrayList(x.s.gpa, &x.s.out); defer x.s.out = w.toArrayList(); - if (!try screen_state.encodeShadow(x.s.gpa, &pp.shadow, &frame, k.prefix.slice(), k.placed, k.pointer, &w.writer)) continue; + // Within the wire's bound, its head (6 bytes) aside: a page of a + // PDF in a wide window is more, and a message past it ends + // the peer's link (its reader stops at it). + if (!try screen_state.encodeShadow(x.s.gpa, &pp.shadow, &frame, k.prefix.slice(), k.placed, k.pointer, wire.max_payload - 6, &w.writer)) continue; try x.out.append(x.s.gpa, try x.s.gpa.dupe(u8, w.written())); }; } |
