Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit c671134

Browse files
committed
rollback fd with wrong type back to fds array
1 parent f9ee80c commit c671134

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Websocket/Websocket.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,13 @@ protected function getFds()
295295
$rooms = array_diff($this->to, $fds);
296296

297297
foreach ($rooms as $room) {
298-
$fds = array_merge($fds, $this->room->getClients($room));
298+
$clients = $this->room->getClients($room);
299+
// rollback fd with wrong type back to fds array
300+
if (empty($clients) && is_numeric($room)) {
301+
$fds[] = $room;
302+
} else {
303+
$fds = array_merge($fds, $this->room->getClients($clients));
304+
}
299305
}
300306

301307
return array_values(array_unique($fds));

0 commit comments

Comments
 (0)