From 321e03ac4823b47beda2203d781521da5ad4e96a Mon Sep 17 00:00:00 2001 From: Jean Date: Sat, 18 Jul 2026 04:39:57 +0000 Subject: [PATCH] link: set TCP_NODELAY on the uplink so an off-box services link never holds a reply tail --- src/link.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/link.rs b/src/link.rs index 140ed0a..b98f330 100644 --- a/src/link.rs +++ b/src/link.rs @@ -73,6 +73,10 @@ fn redact(line: &str) -> Cow<'_, str> { // never held across the registration key-stretching await. pub async fn run(mut proto: Box, engine: Arc>, addr: &str, mut irc_rx: mpsc::UnboundedReceiver, email: Option, keycard: Option) -> Result<()> { 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 mut lines = BufReader::new(read).lines();