diff options
Diffstat (limited to '')
| -rw-r--r-- | src/message/handshake/init.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/message/handshake/init.rs b/src/message/handshake/init.rs index e4c0fa9..b4604b6 100644 --- a/src/message/handshake/init.rs +++ b/src/message/handshake/init.rs @@ -2,6 +2,7 @@ use crate::Deserialize; use crate::Serialize; /// The first few bytes sent to the core to initialize the connection and setup if we want to use tls and compression +#[derive(Clone, Debug)] pub struct Init { pub tls: bool, pub compression: bool, @@ -37,7 +38,15 @@ impl Init { handshake |= 0x02; } - return handshake.serialize().unwrap(); + // Select Protocol 2: Datastream + + let mut init: Vec<u8> = vec![]; + + // Add handshake and protocol to our buffer + init.extend(handshake.serialize().unwrap()); + init.extend(crate::message::Protocol::Datastream.serialize()); + + return init; } pub fn parse(buf: &[u8]) -> Self { |
