http_headers_done_receiving

This commit is contained in:
sjorsdonkers
2025-08-13 14:29:23 +02:00
parent f6c68e4580
commit c0106a238b
5 changed files with 101 additions and 27 deletions

View File

@@ -63,7 +63,8 @@ pub const Notification = struct {
http_request_fail: List = .{},
http_request_start: List = .{},
http_request_intercept: List = .{},
http_request_complete: List = .{},
http_header_received: List = .{},
http_headers_done_receiving: List = .{},
notification_created: List = .{},
};
@@ -75,7 +76,8 @@ pub const Notification = struct {
http_request_fail: *const RequestFail,
http_request_start: *const RequestStart,
http_request_intercept: *const RequestIntercept,
http_request_complete: *const RequestComplete,
http_header_received: *const ResponseHeader,
http_headers_done_receiving: *const ResponseHeadersDone,
notification_created: *Notification,
};
const EventType = std.meta.FieldEnum(Events);
@@ -102,17 +104,21 @@ 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,
};
pub const RequestFail = struct {
transfer: *Transfer,
err: anyerror,
};
pub const RequestComplete = struct {
id: usize,
url: *const std.Uri,
status: u16,
};
pub fn init(allocator: Allocator, parent: ?*Notification) !*Notification {
// This is put on the heap because we want to raise a .notification_created
// event, so that, something like Telemetry, can receive the