diff options
| author | Max Audron <audron@cocaine.farm> | 2021-01-02 19:57:06 +0100 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2021-01-02 19:57:06 +0100 |
| commit | 13734288dbc63c48af0b8f75f0453f0d30b750a7 (patch) | |
| tree | 6396e113041ca61e26aaed3a782da445e461549d /src/message/handshake/init.rs | |
| parent | update (diff) | |
rework handshakemessage parsing
Diffstat (limited to 'src/message/handshake/init.rs')
| -rw-r--r-- | src/message/handshake/init.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/message/handshake/init.rs b/src/message/handshake/init.rs index e4c0fa9..860df8a 100644 --- a/src/message/handshake/init.rs +++ b/src/message/handshake/init.rs @@ -37,7 +37,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 { |
