[ws] Updated onError handle to make sure to close if conditions aren't met

This commit is contained in:
Chris Boden 2013-10-14 10:25:51 -04:00
parent 78b6e2b6c8
commit ef5ece0739

View File

@ -149,10 +149,8 @@ class WsServer implements HttpServerInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function onError(ConnectionInterface $conn, \Exception $e) { public function onError(ConnectionInterface $conn, \Exception $e) {
if ($conn->WebSocket->established) { if ($conn->WebSocket->established && $this->connections->contains($conn)) {
if ($this->connections->contains($conn)) { $this->component->onError($this->connections[$conn], $e);
$this->component->onError($this->connections[$conn], $e);
}
} else { } else {
$conn->close(); $conn->close();
} }