Skip to content

Commit

Permalink
fix s3ReadableStream
Browse files Browse the repository at this point in the history
  • Loading branch information
cirospaciari committed Dec 28, 2024
1 parent ade72ec commit 23e416f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
11 changes: 0 additions & 11 deletions src/s3.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1353,15 +1353,6 @@ pub const AWSCredentials = struct {
);
return;
}
if (chunk.list.items.len == 0) {
readable.ptr.Bytes.onData(
.{
.done = {},
},
bun.default_allocator,
);
return;
}
readable.ptr.Bytes.onData(
.{
.temporary_and_done = bun.ByteList.initConst(chunk.list.items),
Expand All @@ -1371,8 +1362,6 @@ pub const AWSCredentials = struct {
return;
}
}
var buffer = chunk;
buffer.deinit();
}

pub fn deinit(this: *@This()) void {
Expand Down
3 changes: 1 addition & 2 deletions test/js/bun/s3/s3-stream-leak-fixture.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/js/bun/s3/s3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ describe.skipIf(!s3Options.accessKeyId)("s3", () => {
it(
"fsFile.stream() should not leak",
async () => {
const dir = tempDirWithFiles("bun-write-leak-fixture", {
const dir = tempDirWithFiles("s3-stream-leak-fixture", {
"s3-stream-leak-fixture.js": await Bun.file(path.join(import.meta.dir, "s3-stream-leak-fixture.js")).text(),
"out.bin": "here",
});
Expand Down Expand Up @@ -651,7 +651,7 @@ describe.skipIf(!s3Options.accessKeyId)("s3", () => {
it(
"fsFile.writer().write() should not leak",
async () => {
const dir = tempDirWithFiles("bun-write-leak-fixture", {
const dir = tempDirWithFiles("s3-writer-leak-fixture", {
"s3-writer-leak-fixture.js": await Bun.file(path.join(import.meta.dir, "s3-writer-leak-fixture.js")).text(),
"out.bin": "here",
});
Expand Down

0 comments on commit 23e416f

Please sign in to comment.