Merge pull request #4695 from maxpoulin64/fix/oidentd-crash-race-condition
Don't crash on oidentd socket race condition
This commit is contained in:
commit
7c9ed14909
@ -116,9 +116,15 @@ 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) {
|
||||
throw new Error("Socket has no remote or local port");
|
||||
// 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.
|
||||
log.warn(
|
||||
`oidentd: socket has no remote or local port (id=${id}). See https://github.com/thelounge/thelounge/pull/4695.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
file +=
|
||||
|
Loading…
Reference in New Issue
Block a user