Skip to content

Commit 2b3db89

Browse files
committed
Restored to a previous version
Allows fixing the bug mentioned in #89 (comment)
1 parent aaba8d3 commit 2b3db89

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/Server.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,15 @@ class Server {
700700
this.connections[socket.hash].buffers[socket.clientbuffer].connected = false;
701701
}
702702
if (this.connections[socket.hash]) {
703-
for (let i = 0; i < this.connections[socket.hash].parents.length; i++) {
704-
if (this.connections[socket.hash].parents[i] == socket)
703+
let i;
704+
for (i = 0; i < this.connections[socket.hash].parents.length; i++) {
705+
if (this.connections[socket.hash].parents[i] == socket) {
705706
break;
707+
}
706708
}
707-
let i=0;
708709
if (i < this.connections[socket.hash].parents.length) {
709710
this.connections[socket.hash].users--;
710-
if(this.connections[socket.hash].users <= 1)
711-
this.connections[socket.hash].parents.splice(i, 1);
711+
this.connections[socket.hash].parents.splice(i, 1);
712712
if (this.connections[socket.hash].parents.length == 0) {
713713
this.connections[socket.hash].connected = false;
714714
this.connections[socket.hash].write(`AWAY :away-${Math.floor(Date.now() / 1000)}\n`);

0 commit comments

Comments
 (0)