mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
fix overflow and debug units
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user