Add length of HandshakeResponsePacket

This commit is contained in:
Daniel Akhterov 2019-06-14 15:42:19 -07:00
parent b6af918ac1
commit 8d15a8e97b

View File

@ -161,5 +161,11 @@ impl Serialize for HandshakeResponsePacket {
}
}
}
// Get length in little endian bytes
// packet length = byte[0] + (byte[1]<<8) + (byte[2]<<16)
buf[0] = buf.len().to_le_bytes()[0];
buf[1] = buf.len().to_le_bytes()[1];
buf[2] = buf.len().to_le_bytes()[2];
}
}