From 06ac5ed15ca60d81b7c4e1ded6494fb21eb55011 Mon Sep 17 00:00:00 2001 From: Yonle Date: Thu, 4 Jan 2024 13:56:47 +0700 Subject: [PATCH] bouncer: updateSess() after client disconnect too. Signed-off-by: Yonle --- bouncer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bouncer.js b/bouncer.js index e7782a8..690cc58 100644 --- a/bouncer.js +++ b/bouncer.js @@ -120,7 +120,10 @@ module.exports = (ws, req) => { ws.on('error', console.error); ws.on('close', _ => { console.log(process.pid, "---", "Sock", ws.id, "has disconnected.", `(${howManyOrphanSess()+1} orphans)`); - if (csess.has(ws.id)) csess.set(ws.id, null); // set as orphan. + if (csess.has(ws.id)) { + csess.set(ws.id, null); // set as orphan. + updateSess(ws.id); // change relays relay.client object + } for (i of ws.EOSETimeout) { clearTimeout(i[1]);