Skip to content

Commit

Permalink
ident: close connections if they don't send data
Browse files Browse the repository at this point in the history
  • Loading branch information
brunnre8 committed May 9, 2024
1 parent 1267908 commit 29fcc2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/identification.ts
Expand Up @@ -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();
Expand Down

0 comments on commit 29fcc2d

Please sign in to comment.