From 9a35690e98c249f6c64a2ba74e246c609fa6cf27 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Tue, 8 Nov 2011 09:46:48 -0500 Subject: [PATCH] onClose bug fix Fixed a bug where WebSocket::onClose could have a missed lookup from closing too soon --- lib/Ratchet/Protocol/WebSocket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Ratchet/Protocol/WebSocket.php b/lib/Ratchet/Protocol/WebSocket.php index c788a66..8171a09 100644 --- a/lib/Ratchet/Protocol/WebSocket.php +++ b/lib/Ratchet/Protocol/WebSocket.php @@ -106,9 +106,9 @@ class WebSocket implements ProtocolInterface { } public function onClose(SocketInterface $conn) { - $cmds = $this->_app->onClose($conn); + $cmds = $this->prepareCommand($this->_app->onClose($conn)); unset($this->_clients[$conn]); - return $this->prepareCommand($cmds); + return $cmds; } /**