From 1dcfc8787e86ed94d216976e621a49fc488e8214 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 8 Dec 2025 18:00:55 -0800 Subject: update all readFileAlloc() to accept Io instance --- lib/std/Build/WebServer.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/std/Build/WebServer.zig') diff --git a/lib/std/Build/WebServer.zig b/lib/std/Build/WebServer.zig index 38a7a73588..72306cbab9 100644 --- a/lib/std/Build/WebServer.zig +++ b/lib/std/Build/WebServer.zig @@ -469,11 +469,12 @@ pub fn serveFile( content_type: []const u8, ) !void { const gpa = ws.gpa; + const io = ws.graph.io; // The desired API is actually sendfile, which will require enhancing http.Server. // We load the file with every request so that the user can make changes to the file // and refresh the HTML page without restarting this server. - const file_contents = path.root_dir.handle.readFileAlloc(path.sub_path, gpa, .limited(10 * 1024 * 1024)) catch |err| { - log.err("failed to read '{f}': {s}", .{ path, @errorName(err) }); + const file_contents = path.root_dir.handle.readFileAlloc(io, path.sub_path, gpa, .limited(10 * 1024 * 1024)) catch |err| { + log.err("failed to read '{f}': {t}", .{ path, err }); return error.AlreadyReported; }; defer gpa.free(file_contents); -- cgit v1.2.3