mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-10 05:11:46 -04:00
HttpClient Improvements
1 - Track owner of a request (for simpler / more accurate abort (TBD))
2 - Create Transfer upfront, make everything work on Transfer (not Request)
This helps remove ambiguity about cleanup and simplifies layers. For example
Robots request is just another normal request, not a special case. This gives
everything a stable address (the *Transfer which can be looked up by id)
This commit is contained in:
20 files changed
+550
-528
No files matched your search
@@ -21,9 +21,7 @@ const lp = @import("lightpanda");
|
||||
|
||||
const Frame = @import("browser/Frame.zig");
|
||||
const Transfer = @import("browser/HttpClient.zig").Transfer;
|
||||
const Request = @import("browser/HttpClient.zig").Request;
|
||||
const Response = @import("browser/HttpClient.zig").Response;
|
||||
const InterceptContext = @import("network/layer/InterceptionLayer.zig").InterceptContext;
|
||||
|
||||
const log = lp.log;
|
||||
const List = std.DoublyLinkedList;
|
||||
@@ -170,11 +168,11 @@ pub const FrameLoaded = struct {
|
||||
};
|
||||
|
||||
pub const RequestStart = struct {
|
||||
request: *Request,
|
||||
transfer: *Transfer,
|
||||
};
|
||||
|
||||
pub const RequestIntercept = struct {
|
||||
request: *Request,
|
||||
transfer: *Transfer,
|
||||
wait_for_interception: *bool,
|
||||
};
|
||||
|
||||
@@ -185,21 +183,21 @@ pub const RequestAuthRequired = struct {
|
||||
|
||||
pub const ResponseData = struct {
|
||||
data: []const u8,
|
||||
request: *Request,
|
||||
transfer: *Transfer,
|
||||
};
|
||||
|
||||
pub const ResponseHeaderDone = struct {
|
||||
request: *Request,
|
||||
transfer: *Transfer,
|
||||
response: *const Response,
|
||||
};
|
||||
|
||||
pub const RequestDone = struct {
|
||||
request: *Request,
|
||||
transfer: *Transfer,
|
||||
content_length: usize,
|
||||
};
|
||||
|
||||
pub const RequestFail = struct {
|
||||
request: *Request,
|
||||
transfer: *Transfer,
|
||||
err: anyerror,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user