diff options
Diffstat (limited to 'src/ninep/sources.zig')
| -rw-r--r-- | src/ninep/sources.zig | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/ninep/sources.zig b/src/ninep/sources.zig index b0408594..846ab758 100644 --- a/src/ninep/sources.zig +++ b/src/ninep/sources.zig @@ -102,11 +102,7 @@ pub fn handle(p: *Pardes, req: Req) Reply { }, .read => { if (found.dir) return Reply.fail(req.tag, E.PERM); - const off: usize = @intCast(@min(req.off, found.contents.len)); - const bytes = found.contents[off..][0..@min(req.size, found.contents.len - off)]; - const out = p.fs.stage(p.gpa); - out.appendSlice(p.gpa, bytes) catch return Reply.fail(req.tag, E.NOMEM); - return .{ .tag = req.tag, .payload = .{ .staged = @intCast(bytes.len) } }; + return tree.window(p, req, found.contents); }, else => return Reply.fail(req.tag, E.PERM), } |
