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 a858aa9 commit 34741ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/identification.ts
Expand Up @@ -66,6 +66,10 @@ 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}`);
socket.destroy();
});
socket.once("data", (data) => {
this.respondToIdent(socket, data);
socket.end();
Expand Down

0 comments on commit 34741ea

Please sign in to comment.