Merge pull request #449 from karlseguin/longer_timeout
Some checks failed
e2e-test / zig build release (push) Has been cancelled
wpt / web platform tests (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
e2e-test / puppeteer (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled

allow longer timeouts (u8 -> u16)
This commit is contained in:
Pierre Tachoire
2025-02-27 09:11:25 +01:00
committed by GitHub

View File

@@ -142,7 +142,7 @@ const Command = struct {
const Serve = struct {
host: []const u8,
port: u16,
timeout: u8,
timeout: u16,
};
const Fetch = struct {
@@ -259,7 +259,7 @@ fn parseServeArgs(
) !Command.Serve {
var host: []const u8 = "127.0.0.1";
var port: u16 = 9222;
var timeout: u8 = 3;
var timeout: u16 = 3;
while (args.next()) |opt| {
if (std.mem.eql(u8, "--host", opt)) {
@@ -290,7 +290,7 @@ fn parseServeArgs(
return error.MissingTimeout;
};
timeout = std.fmt.parseInt(u8, str, 10) catch |err| {
timeout = std.fmt.parseInt(u16, str, 10) catch |err| {
log.err("--timeout value is invalid: {}", .{err});
return error.InvalidTimeout;
};