diff --git a/mason-mariadb/src/protocol/client.rs b/mason-mariadb/src/protocol/client.rs index 230d2dc5..c91df24e 100644 --- a/mason-mariadb/src/protocol/client.rs +++ b/mason-mariadb/src/protocol/client.rs @@ -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]; } }