Skip to content

Commit

Permalink
Actually do not close connection after ERR_INPUTTOOLONG
Browse files Browse the repository at this point in the history
The change in 7db845c was incomplete.
  • Loading branch information
progval authored and spb committed Aug 11, 2024
1 parent 8478f07 commit 4d39882
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sable_ircd/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 4d39882

Please sign in to comment.