mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
Create Client.Transfer earlier.
On client.request(req) we now immediately wrap the request into a Transfer. This results in less copying of the Request object. It also makes the transfer.uri available, so CDP no longer needs to std.Uri(request.url) anymore. The main advantage is that it's easier to manage resources. There was a use- after free before due to the sensitive nature of the tranfer's lifetime. There were also corner cases where some resources might not be freed. This is hopefully fixed with the lifetime of Transfer being extended.
This commit is contained in:
@@ -219,7 +219,7 @@ pub const Headers = struct {
|
||||
return .{ .headers = header_list };
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Headers) void {
|
||||
pub fn deinit(self: *const Headers) void {
|
||||
c.curl_slist_free_all(self.headers);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user