From 63cc1d2fe15d21a15f9eaa1c5962962ebc5bbb7f Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 20 Mar 2020 23:20:38 +0100 Subject: [PATCH] main: always do full session reset --- src/main.rs | 4 +--- src/session.rs | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 741b41c..5214b1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -152,9 +152,7 @@ fn main() -> ! { server.for_each(|mut socket, session| { if ! socket.is_open() { let _ = socket.listen(TCP_PORT); - if session.is_dirty() { - session.reset(); - } + session.reset(); } else if socket.can_send() && socket.can_recv() && socket.send_capacity() - socket.send_queue() > 128 { match socket.recv(|buf| session.feed(buf)) { Ok(SessionOutput::Nothing) => {} diff --git a/src/session.rs b/src/session.rs index aeeb95f..664c839 100644 --- a/src/session.rs +++ b/src/session.rs @@ -79,10 +79,6 @@ impl Session { self.report_pending = [false; CHANNELS]; } - pub fn is_dirty(&self) -> bool { - self.reader.pos > 0 - } - pub fn reporting(&self) -> bool { self.reporting }