Skip to content

Commit 28008d8

Browse files
committed
allow longer timeouts (u8 -> u16)
1 parent 08e99a3 commit 28008d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const Command = struct {
142142
const Serve = struct {
143143
host: []const u8,
144144
port: u16,
145-
timeout: u8,
145+
timeout: u16,
146146
};
147147

148148
const Fetch = struct {
@@ -259,7 +259,7 @@ fn parseServeArgs(
259259
) !Command.Serve {
260260
var host: []const u8 = "127.0.0.1";
261261
var port: u16 = 9222;
262-
var timeout: u8 = 3;
262+
var timeout: u16 = 3;
263263

264264
while (args.next()) |opt| {
265265
if (std.mem.eql(u8, "--host", opt)) {
@@ -290,7 +290,7 @@ fn parseServeArgs(
290290
return error.MissingTimeout;
291291
};
292292

293-
timeout = std.fmt.parseInt(u8, str, 10) catch |err| {
293+
timeout = std.fmt.parseInt(u16, str, 10) catch |err| {
294294
log.err("--timeout value is invalid: {}", .{err});
295295
return error.InvalidTimeout;
296296
};

0 commit comments

Comments
 (0)