From 12679081c848ee2a1fc4acb894f81b77c97b56aa Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Thu, 9 May 2024 17:44:58 +0200 Subject: [PATCH] ident: fix write after connection end We only respond once to data, then half-close the connection. Hence, we should only listen to a single data event as well, else if the remote doesn't stop sending data we keep trying to write to the closed write end of the pipe. --- server/identification.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/identification.ts b/server/identification.ts index 44dff894..2fc1f758 100644 --- a/server/identification.ts +++ b/server/identification.ts @@ -66,7 +66,7 @@ class Identification { serverConnection(socket: Socket) { socket.on("error", (err: string) => log.error(`Identd socket error: ${err}`)); - socket.on("data", (data) => { + socket.once("data", (data) => { this.respondToIdent(socket, data); socket.end(); });