-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EOF during deserialization in minetest-protocol #1
Comments
The exact packet that fails to parse for me (and that is sent by the stable client) is: It gets deserialized into (wire/packet.rs line 401): This leads to: It consumes the tag ( This causes it to be deserialized as a ToServerCommand while the packet has been fully consumed.
|
It works just fine when changing impl Deserialize for InnerBody {
type Output = Self;
fn deserialize(deser: &mut Deserializer) -> DeserializeResult<Self> {
use InnerBody::*;
// HACK this is probably a bad idea
if deser.remaining() == 1 {
return Ok(Control(ControlBody::Ping)) // the only ControlBody without extra data (except Disconnect)
}
let packet_type = u8::deserialize(deser)?;
match packet_type {
0 => Ok(Control(ControlBody::deserialize(deser)?)),
1 => Ok(Original(OriginalBody::deserialize(deser)?)),
2 => Ok(Split(SplitBody::deserialize(deser)?)),
_ => bail!(DeserializeError::InvalidPacketKind(packet_type)),
}
}
} Of course not a real fix, but it does work with this. |
Attempting to use minetest-protocol (both 0.1.4 from crates.io and the latest git version) for a server fails when connecting with a minetest client (5.9.1, but I also tried using the latest on arch linux).
The client shows "Connecting to server..." for a moment, then "Access denied. Reason: Connection aborted (protocol error?)."
(maybe) relevant log from
minetest --trace
:This line seems to indicate the server sends a disconnect (after failing to parse a packet?):
2025-01-01 22:45:47: TRACE[ConnectionReceive]: con(68/40310)DISCO: Removing peer 1
Relevant log from just printing all packets (and the code that generated this):
The text was updated successfully, but these errors were encountered: