link: set TCP_NODELAY on the uplink so an off-box services link never holds a reply tail

This commit is contained in:
Jean Chevronnet 2026-07-18 04:39:57 +00:00
parent ce9c802d0a
commit 321e03ac48
No known key found for this signature in database

View file

@ -73,6 +73,10 @@ fn redact(line: &str) -> Cow<'_, str> {
// never held across the registration key-stretching await. // never held across the registration key-stretching await.
pub async fn run(mut proto: Box<dyn Protocol>, engine: Arc<Mutex<Engine>>, addr: &str, mut irc_rx: mpsc::UnboundedReceiver<NetAction>, email: Option<crate::config::Email>, keycard: Option<crate::config::Keycard>) -> Result<()> { pub async fn run(mut proto: Box<dyn Protocol>, engine: Arc<Mutex<Engine>>, addr: &str, mut irc_rx: mpsc::UnboundedReceiver<NetAction>, email: Option<crate::config::Email>, keycard: Option<crate::config::Keycard>) -> Result<()> {
let stream = TcpStream::connect(addr).await?; let stream = TcpStream::connect(addr).await?;
// Disable Nagle: service replies are small multi-line bursts, and without this
// the last segment of a reply is held ~40ms waiting on a delayed ACK, so a
// HELP visibly lags before it lands. Every ircd sets this on every socket.
stream.set_nodelay(true)?;
let (read, mut write) = stream.into_split(); let (read, mut write) = stream.into_split();
let mut lines = BufReader::new(read).lines(); let mut lines = BufReader::new(read).lines();