mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Fetch: make FetchStream live longer
This commit is contained in:
parent
6244f5c6cb
commit
d7bf608821
1 changed files with 7 additions and 7 deletions
|
|
@ -1092,17 +1092,17 @@ fn initResource(f: *Fetch, uri: std.Uri, resource: *Resource, reader_buffer: []u
|
|||
|
||||
var want_oid_buf: [git.Oid.max_formatted_length]u8 = undefined;
|
||||
_ = std.fmt.bufPrint(&want_oid_buf, "{f}", .{want_oid}) catch unreachable;
|
||||
var fetch_stream: git.Session.FetchStream = undefined;
|
||||
session.fetch(&fetch_stream, &.{&want_oid_buf}, reader_buffer) catch |err| {
|
||||
return f.fail(f.location_tok, try eb.printString("unable to create fetch stream: {t}", .{err}));
|
||||
};
|
||||
errdefer fetch_stream.deinit();
|
||||
|
||||
resource.* = .{ .git = .{
|
||||
.session = session,
|
||||
.fetch_stream = fetch_stream,
|
||||
.fetch_stream = undefined,
|
||||
.want_oid = want_oid,
|
||||
} };
|
||||
const fetch_stream = &resource.git.fetch_stream;
|
||||
session.fetch(fetch_stream, &.{&want_oid_buf}, reader_buffer) catch |err| {
|
||||
return f.fail(f.location_tok, try eb.printString("unable to create fetch stream: {t}", .{err}));
|
||||
};
|
||||
errdefer fetch_stream.deinit(fetch_stream);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue