Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions mordant-baseline.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[bun_ast]

[bun_bundler]
"defaulted_failure:src/bundler/bundle_v2.rs" = 2
"narrowed_two_ways:src/bundler/bundle_v2.rs" = 1
Expand Down Expand Up @@ -31,7 +29,6 @@
"defaulted_failure:src/runtime/server/RequestContext.rs" = 1
"defaulted_failure:src/runtime/test_runner/pretty_format.rs" = 4
"error_collapsed_to_bool:src/runtime/api/bun/Terminal.rs" = 1
"error_collapsed_to_bool:src/runtime/api/bun/h2_frame_parser.rs" = 32
"error_collapsed_to_bool:src/runtime/ffi/ffi_body.rs" = 1
"field_valid_only_when:src/runtime/shell/builtin/rm.rs" = 1
"reimplemented_helper:src/runtime/api/bun/Terminal.rs" = 1
Expand All @@ -44,7 +41,5 @@
"unchecked_construction:src/runtime/server/HTMLBundle.rs" = 2
"unchecked_construction:src/runtime/server/server_body.rs" = 5

[bun_sql_jsc]

[bun_sys]
"error_collapsed_to_bool:src/sys/lib.rs" = 4
16 changes: 9 additions & 7 deletions src/runtime/api/bun/h2_frame_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ impl UInt31WithReserved {
self.0
}
#[inline]
fn write(self, writer: &mut impl WireWriter) -> bool {
fn write(self, writer: &mut impl WireWriter) -> bun_io::Result<()> {
let mut value: u32 = self.uint31();
if self.reserved() {
value |= 0x8000_0000;
}
value = value.swap_bytes();
writer.write_all(&value.to_ne_bytes()).is_ok()
writer.write_all(&value.to_ne_bytes())
}
}

Expand All @@ -320,10 +320,10 @@ const _: () = assert!(core::mem::size_of::<StreamPriority>() == StreamPriority::
impl StreamPriority {
pub(crate) const BYTE_SIZE: usize = 5;
#[inline]
fn write(self, writer: &mut impl WireWriter) -> bool {
fn write(self, writer: &mut impl WireWriter) -> bun_io::Result<()> {
let mut swap = self;
swap.stream_identifier = swap.stream_identifier.swap_bytes();
writer.write_all(bytemuck::bytes_of(&swap)).is_ok()
writer.write_all(bytemuck::bytes_of(&swap))
}
}

Expand All @@ -350,7 +350,7 @@ impl Default for FrameHeader {
impl FrameHeader {
pub const BYTE_SIZE: usize = 9;
#[inline]
fn write(&self, writer: &mut impl WireWriter, frames_sent: &Cell<u64>) -> bool {
fn write(&self, writer: &mut impl WireWriter, frames_sent: &Cell<u64>) -> bun_io::Result<()> {
frames_sent.set(frames_sent.get() + 1);
let mut buf = [0u8; Self::BYTE_SIZE];
buf[0] = ((self.length >> 16) & 0xFF) as u8;
Expand All @@ -359,7 +359,7 @@ impl FrameHeader {
buf[3] = self.type_;
buf[4] = self.flags;
buf[5..9].copy_from_slice(&self.stream_identifier.to_be_bytes());
writer.write_all(&buf).is_ok()
writer.write_all(&buf)
}
/// Decode a complete 9-byte big-endian frame header.
///
Expand Down Expand Up @@ -1427,7 +1427,9 @@ impl Stream {
length: 0,
};
owned_frame = Some(frame);
break 'brk data_header.write(&mut writer, &client.frames_sent_legacy);
break 'brk data_header
.write(&mut writer, &client.frames_sent_legacy)
.is_ok();
} else {
let max_size = frame_remaining
.min(
Expand Down
Loading