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.
This commit is contained in:
Reto Brunner 2024-05-09 17:44:58 +02:00
parent 0e48014d5a
commit 12679081c8

View file

@ -66,7 +66,7 @@ class Identification {
serverConnection(socket: Socket) { serverConnection(socket: Socket) {
socket.on("error", (err: string) => log.error(`Identd socket error: ${err}`)); socket.on("error", (err: string) => log.error(`Identd socket error: ${err}`));
socket.on("data", (data) => { socket.once("data", (data) => {
this.respondToIdent(socket, data); this.respondToIdent(socket, data);
socket.end(); socket.end();
}); });