Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/runtime/webcore/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,6 @@ pub struct NetworkSink {
pub(crate) upstream_error: jsc::strong::Optional,
pub(crate) ended: bool,
pub(crate) done: bool,
pub(crate) cancel: bool,
}

impl Default for NetworkSink {
Expand All @@ -2202,7 +2201,6 @@ impl Default for NetworkSink {
upstream_error: jsc::strong::Optional::empty(),
ended: false,
done: false,
cancel: false,
}
}
}
Expand Down Expand Up @@ -2336,7 +2334,6 @@ impl NetworkSink {
self.pending.result = Writable::Done;
self.pending.run();
self.source.close(None);
self.cancel = true;
self.finalize();
}

Expand Down Expand Up @@ -2522,16 +2519,7 @@ impl NetworkSink {
if self.task.is_some() && !self.done {
// we need to wait for the task to end
self.end_promise = JSPromiseStrong::init(self.global_this());
let value = self.end_promise.value();
if !self.ended {
self.ended = true;
// we need to send EOF
if let Some(task) = self.task_ref() {
let _ = task.write_bytes(b"", true);
}
self.source.close(None);
}
return bun_sys::Result::Ok(value);
return bun_sys::Result::Ok(self.end_promise.value());
}
// task already detached
bun_sys::Result::Ok(JSValue::js_number(0.0))
Expand Down