fix overflow and debug units

This commit is contained in:
Karl Seguin
2025-08-05 20:16:54 +08:00
parent cabd4fa718
commit 06984ace21
2 changed files with 4 additions and 4 deletions

View File

@@ -406,7 +406,7 @@ pub const Page = struct {
std.debug.print("\nprimary schedule: {d}\n", .{self.scheduler.primary.count()});
var it = self.scheduler.primary.iterator();
while (it.next()) |task| {
std.debug.print(" - {s} complete: {any}\n", .{ task.name, task.ms - now });
std.debug.print(" - {s} schedule: {d}ms\n", .{ task.name, task.ms - now });
}
}
@@ -414,7 +414,7 @@ pub const Page = struct {
std.debug.print("\nsecondary schedule: {d}\n", .{self.scheduler.secondary.count()});
var it = self.scheduler.secondary.iterator();
while (it.next()) |task| {
std.debug.print(" - {s} complete: {any}\n", .{ task.name, task.ms - now });
std.debug.print(" - {s} schedule: {d}ms\n", .{ task.name, task.ms - now });
}
}
}

View File

@@ -560,7 +560,7 @@ pub const Transfer = struct {
if (hdr._content_type_len == 0) {
const CONTENT_TYPE_LEN = "content-type:".len;
if (buf_len > CONTENT_TYPE_LEN) {
if (header.len > CONTENT_TYPE_LEN) {
if (std.ascii.eqlIgnoreCase(header[0..CONTENT_TYPE_LEN], "content-type:")) {
const value = std.mem.trimLeft(u8, header[CONTENT_TYPE_LEN..], " ");
const len = @min(value.len, hdr._content_type.len);
@@ -572,7 +572,7 @@ pub const Transfer = struct {
{
const SET_COOKIE_LEN = "set-cookie:".len;
if (buf_len > SET_COOKIE_LEN) {
if (header.len > SET_COOKIE_LEN) {
if (std.ascii.eqlIgnoreCase(header[0..SET_COOKIE_LEN], "set-cookie:")) {
const value = std.mem.trimLeft(u8, header[SET_COOKIE_LEN..], " ");
transfer.req.cookie.jar.populateFromResponse(&transfer.uri, value) catch |err| {