Skip to content

Commit

Permalink
chore(legacy ping): remove debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
anweisen committed Jan 29, 2024
1 parent 6882ccd commit 8ea99b0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ async fn handle_legacy(n: usize, peek_bytes: &[u8], composed_configs: &ComposedC
// 1.6 -> FE 01 FA .. |
// 1.4 - 1.5 -> FE 01 | handled the same
// Beta1.8 - 1.3 -> FE

let post_1_3 = n > 1 && peek_bytes[1] == 0x01;

let characters = match post_1_3 {
Expand All @@ -122,7 +121,6 @@ async fn handle_legacy(n: usize, peek_bytes: &[u8], composed_configs: &ComposedC
};

let utf16_bytes: Vec<u16> = characters.encode_utf16().collect();
println!("UTF-16BE bytes: {:?}", utf16_bytes.iter().map(|b| format!("{:04x}", b)).collect::<Vec<_>>());

let mut response_packet = Vec::new();
// kick packet -> 0xFF
Expand All @@ -132,7 +130,6 @@ async fn handle_legacy(n: usize, peek_bytes: &[u8], composed_configs: &ComposedC
for utf16_byte in utf16_bytes {
response_packet.write_u16(utf16_byte).await.expect("Could not write u16 to buffer");
}
println!("{:?}", response_packet.iter().map(|b| format!("{:02x}", b)).collect::<Vec<_>>());

send_flush_close(&*response_packet, &mut stream).await.expect("TODO: panic message");
}
Expand Down

0 comments on commit 8ea99b0

Please sign in to comment.