aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/message/handshake
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol/message/handshake')
-rw-r--r--src/protocol/message/handshake/types.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/protocol/message/handshake/types.rs b/src/protocol/message/handshake/types.rs
index f099b0f..c809764 100644
--- a/src/protocol/message/handshake/types.rs
+++ b/src/protocol/message/handshake/types.rs
@@ -74,18 +74,19 @@ impl HandshakeQRead for VariantMap {
fn read<T: Read>(s: &mut T, b: &mut [u8]) -> Result<usize, ErrorKind> {
s.read(&mut b[0..4])?;
let (_, len) = i32::parse(&b[0..4])?;
+ let ulen = len as usize;
// Read the 00 00 00 0a VariantType bytes and discard
- s.read(&mut b[4..8])?;
+ s.read(&mut b[4..ulen])?;
- let mut pos = 8;
- let len: usize = len as usize;
- loop {
- if pos >= len { break; }
- pos += Variant::read(s, &mut b[pos..])?;
- pos += Variant::read(s, &mut b[pos..])?;
- }
+// let mut pos = 8;
+// let len: usize = len as usize;
+// loop {
+// if pos >= len { break; }
+// pos += Variant::read(s, &mut b[pos..])?;
+// pos += Variant::read(s, &mut b[pos..])?;
+// }
- return Ok(pos);
+ return Ok(ulen + 4);
}
}
ialize.rs?id=6f9c0d0f2906d05e27f9f11af6cefdf006c2cf4b&follow=1'>refactor variant serialization codeMax Audron-256/+405 2025-02-26add MsgId and BufferId to objects where neededMax Audron-141/+157 2025-02-25enable transparent repr for msgid and bufferidMax Audron-0/+2 2025-02-25Implement BacklogManagerTobias Deiminger-59/+113 2025-02-25Use BufferId in BufferInfoTobias Deiminger-10/+11 2025-02-25Use BufferId in VariantTobias Deiminger-2/+33 2025-02-25Add BufferId as Rust typeTobias Deiminger-0/+39 2025-02-25Use MsgId in MessageTobias Deiminger-18/+6 2025-02-25Use MsgId in VariantTobias Deiminger-20/+37 2025-02-25Add MsgId as Rust typeTobias Deiminger-0/+56 2025-02-24added session manager comments and log messageMax Audron-1/+3 2025-02-23add identity syncable to SessionManagerMax Audron-1/+8 2025-02-23add syncables for IrcUserMax Audron-2/+53 2025-02-23move network config to it's own file and impl it's syncMax Audron-23/+84 2025-02-23add basic network syncablesMax Audron-39/+420 2025-02-23clean up unused_import and unused_variables a bitMax Audron-2/+8 2025-02-23fix server feature errorsMax Audron-28/+23 2025-02-23fix ircchannel and maplist network representationMax Audron-154/+137 2025-02-22replace deprecated failure crate with thiserrorMax Audron-278/+194 2025-02-22update dependencies and fix errorsMax Audron-508/+332 2025-02-22update flakeMax Audron-94/+117 2024-05-22add todos to readmeMax Audron-16/+35