From 29fcc2da053b659ea187f8a9e90d0128c5a60779 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Thu, 9 May 2024 18:35:40 +0200 Subject: [PATCH] ident: close connections if they don't send data --- server/identification.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/identification.ts b/server/identification.ts index 2fc1f758..03a29687 100644 --- a/server/identification.ts +++ b/server/identification.ts @@ -66,6 +66,14 @@ class Identification { serverConnection(socket: Socket) { socket.on("error", (err: string) => log.error(`Identd socket error: ${err}`)); + socket.setTimeout(5000, () => { + log.warn( + `identd: no data received, closing connection to ${ + socket.remoteAddress || "undefined" + }` + ); + socket.destroy(); + }); socket.once("data", (data) => { this.respondToIdent(socket, data); socket.end();