From 10789f85ab7d3ffd4d57f0f402a68880ae9efbd1 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Sun, 11 Aug 2024 20:23:12 +0200 Subject: [PATCH] Actually do not close connection after ERR_INPUTTOOLONG The change in 7db845cd9e19261e8d41005ef1451bd924d7c7cd was incomplete. --- sable_ircd/src/server/mod.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sable_ircd/src/server/mod.rs b/sable_ircd/src/server/mod.rs index 2f95578..74ab984 100644 --- a/sable_ircd/src/server/mod.rs +++ b/sable_ircd/src/server/mod.rs @@ -310,6 +310,14 @@ impl ClientServer { self.connections.write().new_message(msg.source, m); } + ConnectionEventDetail::Error(ConnectionError::InputLineTooLong) => { + if let Ok(conn) = self.connections.get(msg.source) { + conn.send(numeric::InputTooLong::new_for( + &self.node.name().to_string(), + &"*".to_string(), + )) + } + } ConnectionEventDetail::Error(e) => { if let Ok(conn) = self.connections.get(msg.source) { if let Some((userid, user_conn_id)) = conn.user_ids() { @@ -336,17 +344,9 @@ impl ClientServer { .await; } } - match e { - ConnectionError::InputLineTooLong => { - conn.send(numeric::InputTooLong::new_for( - &self.node.name().to_string(), - &"*".to_string(), - )) - } - _ => conn.send(message::Error::new(&e.to_string())), - } + conn.send(message::Error::new(&e.to_string())); + self.connections.write().remove(msg.source); } - self.connections.write().remove(msg.source); } } }