mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-05-22 07:44:46 -07:00
Switch to read_exact in tp-link telnet_send_command
This commit is contained in:
committed by
Cooper Quintin
parent
894f457751
commit
c97212cdc8
@@ -144,9 +144,11 @@ async fn telnet_send_command(
|
||||
let (mut reader, mut writer) = stream.into_split();
|
||||
|
||||
loop {
|
||||
let mut buf = [0];
|
||||
reader.read(&mut buf).await?;
|
||||
if buf[0] == b'#' {
|
||||
let mut next_byte = 0;
|
||||
reader
|
||||
.read_exact(std::slice::from_mut(&mut next_byte))
|
||||
.await?;
|
||||
if next_byte == b'#' {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user