mailformed -> malformed
This commit is contained in:
parent
7c30391e2c
commit
f56b566afb
@ -143,7 +143,7 @@ pub enum PacketError {
|
|||||||
#[error("packet length is out of bounds")]
|
#[error("packet length is out of bounds")]
|
||||||
OutOfBounds,
|
OutOfBounds,
|
||||||
#[error("malformed packet length VarInt")]
|
#[error("malformed packet length VarInt")]
|
||||||
MailformedLength,
|
MalformedLength,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
|||||||
@ -28,7 +28,7 @@ impl PacketDecoder {
|
|||||||
let packet_len = match VarInt::decode_partial(&mut r) {
|
let packet_len = match VarInt::decode_partial(&mut r) {
|
||||||
Ok(len) => len,
|
Ok(len) => len,
|
||||||
Err(VarIntDecodeError::Incomplete) => return Ok(None),
|
Err(VarIntDecodeError::Incomplete) => return Ok(None),
|
||||||
Err(VarIntDecodeError::TooLarge) => Err(PacketError::MailformedLength)?,
|
Err(VarIntDecodeError::TooLarge) => Err(PacketError::MalformedLength)?,
|
||||||
};
|
};
|
||||||
|
|
||||||
if !(0..=MAX_PACKET_SIZE).contains(&packet_len) {
|
if !(0..=MAX_PACKET_SIZE).contains(&packet_len) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user