summaryrefslogtreecommitdiff
path: root/runtime/9p_io.zig
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/9p_io.zig')
-rw-r--r--runtime/9p_io.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/9p_io.zig b/runtime/9p_io.zig
index bcb0f81b..1079b102 100644
--- a/runtime/9p_io.zig
+++ b/runtime/9p_io.zig
@@ -203,7 +203,7 @@ pub const Listener = struct {
// Asked first: a release that runs a held line has none after.
const changes = pardes.ctlfs.changesPane(core, req);
const fills = pardes.ctlfs.handsOff(core, req);
- const reply = core.serveFs(req);
+ const reply = pardes.filesystem.EditHold.retried(&core.fs, req) orelse core.serveFs(req);
const edit_started = core.fs.edit_started;
core.fs.edit_started = false;
// The held Edit write asked again by a retry, its Edit still
@@ -1896,7 +1896,9 @@ pub const Client = struct {
/// same open, as /pane/new answers its own open: a session's last
/// answer, from another client, can never be what comes back. `exec
/// 3<>file`. `more` (`pardes -`'s text after its /pager line) goes in
- /// Twrites at rising offsets, each answer giving the next its budget.
+ /// Twrites at rising offsets. Untimed once connected: the answer comes
+ /// when the session's step has run, however long a loaded machine
+ /// takes over 256 MiB, and a session that died ends the connection.
pub fn ask(gpa: std.mem.Allocator, dial: []const u8, path: []const u8, request: []const u8, more: []const u8) ![]u8 {
if (comptime !supported) return error.Unsupported;
var names: [max_depth][]const u8 = undefined;
@@ -1905,6 +1907,7 @@ pub const Client = struct {
errdefer said = remote;
const s = try startSession(dial, path);
defer endSession(s, false);
+ s.deadline = std.math.maxInt(i64);
const fid = try walkTo(s, names[0..n], &remote);
_ = try s.ask(.{ .open = .{ .fid = fid, .mode = ninep.ordwr } }, &remote);
var written: usize = 0;
@@ -1914,7 +1917,6 @@ pub const Client = struct {
const count = (try s.ask(.{ .write = .{ .fid = fid, .offset = written, .data = chunk } }, &remote)).write;
if (count == 0 or count > chunk.len) return Error.Botch;
written += count;
- s.deadline = nowMs() +| write_budget_ms;
}
var out: std.ArrayList(u8) = .empty;
errdefer out.deinit(gpa);