mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
allow longer timeouts (u8 -> u16)
This commit is contained in:
@@ -142,7 +142,7 @@ const Command = struct {
|
|||||||
const Serve = struct {
|
const Serve = struct {
|
||||||
host: []const u8,
|
host: []const u8,
|
||||||
port: u16,
|
port: u16,
|
||||||
timeout: u8,
|
timeout: u16,
|
||||||
};
|
};
|
||||||
|
|
||||||
const Fetch = struct {
|
const Fetch = struct {
|
||||||
@@ -259,7 +259,7 @@ fn parseServeArgs(
|
|||||||
) !Command.Serve {
|
) !Command.Serve {
|
||||||
var host: []const u8 = "127.0.0.1";
|
var host: []const u8 = "127.0.0.1";
|
||||||
var port: u16 = 9222;
|
var port: u16 = 9222;
|
||||||
var timeout: u8 = 3;
|
var timeout: u16 = 3;
|
||||||
|
|
||||||
while (args.next()) |opt| {
|
while (args.next()) |opt| {
|
||||||
if (std.mem.eql(u8, "--host", opt)) {
|
if (std.mem.eql(u8, "--host", opt)) {
|
||||||
@@ -290,7 +290,7 @@ fn parseServeArgs(
|
|||||||
return error.MissingTimeout;
|
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});
|
log.err("--timeout value is invalid: {}", .{err});
|
||||||
return error.InvalidTimeout;
|
return error.InvalidTimeout;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user