Optimize Network.responseReceived

Add a header iterator to the transfer. This removes the need for NetworkState,
duping header name/values, and the http_header_received event.
This commit is contained in:
Karl Seguin
2025-08-14 15:50:56 +08:00
parent 5100e06f38
commit 96b10f4b85
5 changed files with 81 additions and 80 deletions

View File

@@ -63,8 +63,7 @@ pub const Notification = struct {
http_request_fail: List = .{},
http_request_start: List = .{},
http_request_intercept: List = .{},
http_header_received: List = .{},
http_headers_done_receiving: List = .{},
http_headers_done: List = .{},
notification_created: List = .{},
};
@@ -76,8 +75,7 @@ pub const Notification = struct {
http_request_fail: *const RequestFail,
http_request_start: *const RequestStart,
http_request_intercept: *const RequestIntercept,
http_header_received: *const ResponseHeader,
http_headers_done_receiving: *const ResponseHeadersDone,
http_headers_done: *const ResponseHeadersDone,
notification_created: *Notification,
};
const EventType = std.meta.FieldEnum(Events);
@@ -104,12 +102,6 @@ pub const Notification = struct {
wait_for_interception: *bool,
};
pub const ResponseHeader = struct {
request_id: u64,
status: u16,
header: std.http.Header,
};
pub const ResponseHeadersDone = struct {
transfer: *Transfer,
};