From 6f94491464d4b55a53e2dfd2c42b005b97650b91 Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Sun, 21 May 2023 15:48:18 +0200 Subject: [PATCH] Debugging --- problem_06/bin/client.rs | 3 ++- problem_06/src/frame.rs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/problem_06/bin/client.rs b/problem_06/bin/client.rs index 29961c0..0a5d972 100644 --- a/problem_06/bin/client.rs +++ b/problem_06/bin/client.rs @@ -112,7 +112,8 @@ async fn test_dipatcher_connection( // 13 88 5000 // ] // } - let i_am_dispatcher = [0x81, 0x03, 0x00, 0x42, 0x01, 0x70, 0x13, 0x88]; + // let i_am_dispatcher = [0x81, 0x03, 0x00, 0x42, 0x01, 0x70, 0x13, 0x88]; + let i_am_dispatcher = [0x81, 0x02, 0x00, 0x7b, 0x00, 0x01]; write.write_all(&i_am_dispatcher).await?; diff --git a/problem_06/src/frame.rs b/problem_06/src/frame.rs index e5faa19..cd5fadc 100644 --- a/problem_06/src/frame.rs +++ b/problem_06/src/frame.rs @@ -222,8 +222,11 @@ fn get_u16_vec<'a>(src: &mut Cursor<&'a [u8]>, len: usize) -> Result, E } fn skip(src: &mut Cursor<&[u8]>, n: usize) -> Result<(), Error> { + info!( + "Bytes left: src: {src:?}: n: {n}, remaining: {}", + src.remaining() + ); if src.remaining() < n { - info!("Not enough bytes left: {src:?}: {n}"); return Err(Error::Incomplete); }