mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 05:50:22 +00:00
Don't crash on oidentd socket race condition
This commit is contained in:
parent
7304acd8e0
commit
243cb10e2a
1 changed files with 7 additions and 1 deletions
|
@ -118,7 +118,13 @@ class Identification {
|
|||
|
||||
this.connections.forEach((connection) => {
|
||||
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 be one or more disconnected sockets remaining when we get here.
|
||||
//
|
||||
// Simply skip this socket and not crash the server.
|
||||
log.warn("oidentd: socket has no remote or local port?");
|
||||
return;
|
||||
}
|
||||
|
||||
file +=
|
||||
|
|
Loading…
Reference in a new issue