bouncer: just poke ready function if session is already prepared

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle 2024-05-11 11:01:53 +07:00
parent bc4784bfe0
commit bd425a9e5a

View File

@ -158,8 +158,8 @@ function handleWorker(msg) {
switch (msg.type) {
case "sessreg": {
if (!idents.hasOwnProperty(msg.ident)) return _destroy(msg.id);
if (idents[msg.ident].id === msg.id) return ws.onready(); // if existing is the same as the current one, just poke ready.
const ws = idents[msg.ident];
if (ws.id === msg.id) return ws.onready(); // if existing is the same as the current one, just poke ready.
ws.id = msg.id;
ws.onready();
csess[msg.id] = ws;