Expand description
This module implements the relaying protocol used by the server and client.
//! This module implements the relaying protocol used by the `server` and `client`.
//!
//! Protocol flow:
//!
@@ -1404,7 +1409,12 @@
let content = content.slice(PublicKey::LENGTH..);
Self::RecvPacket { src_key, content }
}
- FrameType::KeepAlive => Self::KeepAlive,
+ FrameType::KeepAlive => {
+ if !content.is_empty() {
+ return Err(InvalidFrameSnafu.build());
+ }
+ Self::KeepAlive
+ }
FrameType::NotePreferred => {
if content.len() != 1 {
return Err(InvalidFrameSnafu.build());
@@ -1844,7 +1854,7 @@
codec.encode(frame.clone(), &mut buf).unwrap();
inject_error(&mut buf);
let decoded = codec.decode(&mut buf);
- prop_assert!(decoded.is_err());
+ prop_assert!(decoded.is_err(), "{:?}", decoded);
}
}
}