Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually do not close connection after ERR_INPUTTOOLONG #137

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading