Add id to error log

This commit is contained in:
Reto Brunner 2023-02-18 11:34:28 +01:00
parent 4cff2ccabe
commit e9a09f5447

View File

@ -116,14 +116,12 @@ class Identification {
refresh() {
let file = "# Warning: file generated by The Lounge: changes will be overwritten!\n";
this.connections.forEach((connection) => {
this.connections.forEach((connection, id) => {
if (!connection.socket.remotePort || !connection.socket.localPort) {
// Race condition: this can happen when more than one socket gets disconnected at
// once, since we `refresh()` for each one being added/removed. This results
// in there possibly being one or more disconnected sockets remaining when we get here.
//
// Simply skip this socket and do not crash the server.
log.warn("oidentd: socket has no remote or local port. See https://github.com/thelounge/thelounge/pull/4695.");
log.warn(`oidentd: socket has no remote or local port (id=${id}). See https://github.com/thelounge/thelounge/pull/4695.`);
return;
}