diff --git a/transports/noise/src/io/framed.rs b/transports/noise/src/io/framed.rs index f41b4110b7b..ceeeaae3834 100644 --- a/transports/noise/src/io/framed.rs +++ b/transports/noise/src/io/framed.rs @@ -68,9 +68,11 @@ impl Codec { } }; + let prefix = u16::to_be_bytes(n as u16); self.encrypt_buffer.truncate(n); - dst.put_u16(n as u16); + //dst.put_u16(n as u16); + dst.put(&prefix[..]); dst.put(&self.encrypt_buffer[..]); Ok(())