fix: don't panic on empty newlines
This commit is contained in:
parent
0682ff9ff4
commit
4b96f57f44
2 changed files with 12 additions and 0 deletions
|
|
@ -57,6 +57,12 @@ impl Client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
match &buffer as &str {
|
||||||
|
"\n" | "\r\n" => return Ok(TcpListenerResult::UpdatedUser(user_state)),
|
||||||
|
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
|
||||||
let command = commands::ClientCommand::new(buffer.clone()).await;
|
let command = commands::ClientCommand::new(buffer.clone()).await;
|
||||||
match command
|
match command
|
||||||
.execute(&mut writer, &info.server_hostname, &mut user_state, info)
|
.execute(&mut writer, &info.server_hostname, &mut user_state, info)
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,12 @@ impl Ts6 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
match &buffer as &str {
|
||||||
|
"\n" | "\r\n" => return Ok(self_clone),
|
||||||
|
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
|
||||||
debug!("received command on ts6 connection: {buffer}");
|
debug!("received command on ts6 connection: {buffer}");
|
||||||
|
|
||||||
let args = buffer
|
let args = buffer
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue