From 86c881a028a34a424496b077c888d9ad50256147 Mon Sep 17 00:00:00 2001 From: Acts1631 Date: Thu, 9 Jul 2026 17:13:04 -0400 Subject: [PATCH] dcc-server: expire idle accepted clients DCC SERVER accepts and retains every peer connection, while the generic DCC timeout explicitly excludes server records. Silent peers can exhaust file descriptors and memory. Apply the existing DCC timeout to accepted DCC SERVER clients until they send their first protocol line. --- src/irc/dcc/dcc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c index fd13165a..d8f2e470 100644 --- a/src/irc/dcc/dcc.c +++ b/src/irc/dcc/dcc.c @@ -461,13 +461,16 @@ static int dcc_timeout_func(void) DCC_REC *dcc = tmp->data; next = tmp->next; - if (dcc->tagread == -1 && now > dcc->created && !IS_DCC_SERVER(dcc)) { + if (now > dcc->created && + ((dcc->tagread == -1 && !IS_DCC_SERVER(dcc)) || + (IS_DCC_SERVER(dcc) && dcc->tagread != -1))) { /* Timed out - don't send DCC REJECT CTCP so CTCP flooders won't affect us and it really doesn't matter that much anyway if the other side doen't get it.. - We don't want dcc servers to time out. */ + Connected DCC SERVER clients must send their first + protocol line before the timeout. */ dcc_close(dcc); } }