Skip to content

Commit

Permalink
Why'd I use LE over network? Lol, this should be BE
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry committed Nov 17, 2024
1 parent 183c87d commit 8c17098
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/shared/src/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Client {
let data_len = buf.len() - size_of::<usize>();
// <len><message>
// ^---^ <-- copy len to here
buf[..size_of::<usize>()].copy_from_slice(&data_len.to_le_bytes());
buf[..size_of::<usize>()].copy_from_slice(&data_len.to_be_bytes());

let fut = async {
let size = buf.len();
Expand Down Expand Up @@ -278,7 +278,7 @@ impl Server {
// <len><message>
// ^---^
if self.msg_len.is_none() && self.buf.len() >= size_of::<usize>() {
self.msg_len = Some(usize::from_le_bytes(
self.msg_len = Some(usize::from_be_bytes(
self.buf[..size_of::<usize>()].try_into().unwrap(),
));

Expand Down

0 comments on commit 8c17098

Please sign in to comment.