Cleaner merge

Switch to non-blocking sockets.

Fix TLS handshake/receive/send ordering
This commit is contained in:
Karl Seguin
2025-03-20 23:09:20 +08:00
parent feb2046549
commit 22aa126b29
12 changed files with 271 additions and 203 deletions

View File

@@ -73,13 +73,13 @@ pub fn CDPT(comptime TypeProvider: type) type {
pub const Browser = TypeProvider.Browser;
pub const Session = TypeProvider.Session;
pub fn init(app: *App, client: TypeProvider.Client) !Self {
pub fn init(app: *App, client: TypeProvider.Client) Self {
const allocator = app.allocator;
return .{
.client = client,
.allocator = allocator,
.browser_context = null,
.browser = try Browser.init(app),
.browser = Browser.init(app),
.message_arena = std.heap.ArenaAllocator.init(allocator),
.browser_context_pool = std.heap.MemoryPool(BrowserContext(Self)).init(allocator),
};

View File

@@ -1,3 +1,21 @@
// Copyright (C) 2023-2024 Lightpanda (Selecy SAS)
//
// Francis Bouvier <francis@lightpanda.io>
// Pierre Tachoire <pierre@lightpanda.io>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std");
const json = std.json;
@@ -17,7 +35,7 @@ const Browser = struct {
session: ?*Session = null,
arena: std.heap.ArenaAllocator,
pub fn init(app: *App) !Browser {
pub fn init(app: *App) Browser {
return .{
.arena = std.heap.ArenaAllocator.init(app.allocator),
};