Add fulfillRequest and more complete continueRequest

This commit is contained in:
Karl Seguin
2025-08-18 18:29:10 +08:00
parent 211012d367
commit f5ec74252d
10 changed files with 231 additions and 96 deletions

View File

@@ -22,14 +22,15 @@ pub const c = @cImport({
@cInclude("curl/curl.h");
});
const Client = @import("Client.zig");
pub const ENABLE_DEBUG = false;
pub const Client = @import("Client.zig");
pub const Transfer = Client.Transfer;
const errors = @import("errors.zig");
const Allocator = std.mem.Allocator;
const ArenaAllocator = std.heap.ArenaAllocator;
pub const ENABLE_DEBUG = false;
// Client.zig does the bulk of the work and is loosely tied to a browser Page.
// But we still need something above Client.zig for the "utility" http stuff
// we need to do, like telemetry. The most important thing we want from this
@@ -221,15 +222,15 @@ pub const Connection = struct {
}
};
pub const Header = struct {
name: []const u8,
value: []const u8,
};
pub const Headers = struct {
headers: *c.curl_slist,
cookies: ?[*c]const u8,
const Header = struct {
name: []const u8,
value: []const u8,
};
pub fn init() !Headers {
const header_list = c.curl_slist_append(null, "User-Agent: Lightpanda/1.0");
if (header_list == null) return error.OutOfMemory;