ident: close connections if they don't send data

This commit is contained in:
Reto Brunner 2024-05-09 18:35:40 +02:00
parent 12679081c8
commit 29fcc2da05

View file

@ -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();