Skip to content

Commit dc4d8bb

Browse files
committed
fix overflow and debug units
1 parent 0844dd0 commit dc4d8bb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/browser/page.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,15 @@ pub const Page = struct {
372372
std.debug.print("\nprimary schedule: {d}\n", .{self.scheduler.primary.count()});
373373
var it = self.scheduler.primary.iterator();
374374
while (it.next()) |task| {
375-
std.debug.print(" - {s} complete: {any}\n", .{ task.name, task.ms - now });
375+
std.debug.print(" - {s} schedule: {d}ms\n", .{ task.name, task.ms - now });
376376
}
377377
}
378378

379379
{
380380
std.debug.print("\nsecondary schedule: {d}\n", .{self.scheduler.secondary.count()});
381381
var it = self.scheduler.secondary.iterator();
382382
while (it.next()) |task| {
383-
std.debug.print(" - {s} complete: {any}\n", .{ task.name, task.ms - now });
383+
std.debug.print(" - {s} schedule: {d}ms\n", .{ task.name, task.ms - now });
384384
}
385385
}
386386
}

src/http/Client.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ pub const Transfer = struct {
560560

561561
if (hdr._content_type_len == 0) {
562562
const CONTENT_TYPE_LEN = "content-type:".len;
563-
if (buf_len > CONTENT_TYPE_LEN) {
563+
if (header.len > CONTENT_TYPE_LEN) {
564564
if (std.ascii.eqlIgnoreCase(header[0..CONTENT_TYPE_LEN], "content-type:")) {
565565
const value = std.mem.trimLeft(u8, header[CONTENT_TYPE_LEN..], " ");
566566
const len = @min(value.len, hdr._content_type.len);
@@ -572,7 +572,7 @@ pub const Transfer = struct {
572572

573573
{
574574
const SET_COOKIE_LEN = "set-cookie:".len;
575-
if (buf_len > SET_COOKIE_LEN) {
575+
if (header.len > SET_COOKIE_LEN) {
576576
if (std.ascii.eqlIgnoreCase(header[0..SET_COOKIE_LEN], "set-cookie:")) {
577577
const value = std.mem.trimLeft(u8, header[SET_COOKIE_LEN..], " ");
578578
transfer.req.cookie.jar.populateFromResponse(&transfer.uri, value) catch |err| {

0 commit comments

Comments
 (0)