From 8d15a8e97bf028e60edc62bcf20ab58ad449ed37 Mon Sep 17 00:00:00 2001 From: Daniel Akhterov Date: Fri, 14 Jun 2019 15:42:19 -0700 Subject: [PATCH] Add length of HandshakeResponsePacket --- mason-mariadb/src/protocol/client.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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]; } }