diff options
| author | Max Audron <audron@cocaine.farm> | 2020-01-19 18:08:09 +0100 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2020-01-19 18:08:09 +0100 |
| commit | 59af320a53cdf5bbcbbf5c0b2aa44127e8c5dfdd (patch) | |
| tree | be4d3d060fa0a3431f35da3e968ad84bbba62628 /src/protocol/message/handshake | |
| parent | add ClientLogin (diff) | |
update
Diffstat (limited to 'src/protocol/message/handshake')
| -rw-r--r-- | src/protocol/message/handshake/types.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/protocol/message/handshake/types.rs b/src/protocol/message/handshake/types.rs index f099b0f..c809764 100644 --- a/src/protocol/message/handshake/types.rs +++ b/src/protocol/message/handshake/types.rs @@ -74,18 +74,19 @@ impl HandshakeQRead for VariantMap { fn read<T: Read>(s: &mut T, b: &mut [u8]) -> Result<usize, ErrorKind> { s.read(&mut b[0..4])?; let (_, len) = i32::parse(&b[0..4])?; + let ulen = len as usize; // Read the 00 00 00 0a VariantType bytes and discard - s.read(&mut b[4..8])?; + s.read(&mut b[4..ulen])?; - let mut pos = 8; - let len: usize = len as usize; - loop { - if pos >= len { break; } - pos += Variant::read(s, &mut b[pos..])?; - pos += Variant::read(s, &mut b[pos..])?; - } +// let mut pos = 8; +// let len: usize = len as usize; +// loop { +// if pos >= len { break; } +// pos += Variant::read(s, &mut b[pos..])?; +// pos += Variant::read(s, &mut b[pos..])?; +// } - return Ok(pos); + return Ok(ulen + 4); } } |
