main: fix double brackets sent when socket rx ring buffer wraps around #55

Merged
sb10q merged 2 commits from fix_double_brac into master 2021-01-29 16:18:07 +08:00
Showing only changes of commit 355f10c713 - Show all commits

View File

@ -213,9 +213,10 @@ fn main() -> ! {
socket.close() socket.close()
} else if socket.can_send() && socket.can_recv() { } else if socket.can_send() && socket.can_recv() {
match socket.recv(|buf| session.feed(buf)) { match socket.recv(|buf| session.feed(buf)) {
// SessionInput::Nothing happens when socket RX ring buffer wraps around without // SessionInput::Nothing happens when the line reader parses a string of characters that is not
// the line reader reading a newline character, should do nothing and let // followed by a newline character. Could be due to partial commands not terminated with newline,
// the line reader read from the start of ring buffer in the next loop cycle. // socket RX ring buffer wraps around, or when the command is sent as seperate TCP packets etc.
// Do nothing and feed more data to the line reader in the next loop cycle.
Ok(SessionInput::Nothing) => {} Ok(SessionInput::Nothing) => {}
Ok(SessionInput::Command(command)) => match command { Ok(SessionInput::Command(command)) => match command {
Command::Quit => Command::Quit =>