summaryrefslogtreecommitdiff
path: root/src/9p_io.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 15:47:52 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitc2e58c827bd8d2497c86b2eca23ac096cb972296 (patch)
treeb9e46bee4978e97952d377b6e21f20338dc08d2c /src/9p_io.zig
parent9babe3a63ca06b4b0248d1d21ccb74687c5b188d (diff)
downloadpardes-c2e58c827bd8d2497c86b2eca23ac096cb972296.tar.gz
pardes-c2e58c827bd8d2497c86b2eca23ac096cb972296.zip
A ctl or exec line with no newline runs with its write and fails it, unless it needs more
A last line with no newline was held to the close, so printf bogus > ctl answered 0 and failed only in the log, Edit ,s/zzz/y/ too. A write shorter than its Twrite is the whole of what was written (acme takes each write whole): its tail runs then and a failure is the write's. It is held only when the parser says it needs more -- an open { block, an a/c/i text -- or when the write filled its Twrite and may go on (the listener tells the core the room, msize less its header). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/9p_io.zig')
-rw-r--r--src/9p_io.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig
index 91240b57..7f490f81 100644
--- a/src/9p_io.zig
+++ b/src/9p_io.zig
@@ -261,6 +261,7 @@ pub const Listener = struct {
return conn.reply(&later, "");
}
const core = l.core;
+ core.fs.write_room = if (conn.engine.protocol.msize > 24) conn.engine.protocol.msize - 24 else 0;
const epoch = pardes.turn.epoch;
const restores = pardes.turn.restores;
// Asked first: a release that runs a held line has none after.
@@ -506,6 +507,7 @@ pub const Listener = struct {
/// Answers one QUIC request, on the editor's thread.
fn step(l: *Listener, srv: *Srv, req: pardes.ctlfs.Req) void {
+ l.core.fs.write_room = if (srv.protocol.msize > 24) srv.protocol.msize - 24 else 0;
const reply = l.core.serveFs(req);
srv.reply(&reply, l.core.fsPayload(reply));
if (req.op == .release) l.collectOs();