From f49f63541bb7e6bfc1933486f7c9b7d5dae451ca Mon Sep 17 00:00:00 2001 From: meltyness <86126050+meltyness@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:23:14 -0600 Subject: [PATCH] Add write timeout as well for high latency --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 46b1b62..8112dce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -209,8 +209,9 @@ pub fn main() { }, }; - stream.set_read_timeout(Some(Duration::from_secs(10))); - + stream.set_read_timeout(Some(Duration::from_secs(10))); // for interactive sessions, the user has to type this fast + // for DoS prevention, the server has to tolerate 2*10*(line rate) sessions + stream.set_write_timeout(Some(Duration::from_secs(3))); // Stage 0.5: Determine if this is a client // TODO: completely encapsulate this into the session eventually... let v4_binding = clients_v4_container.clone();