From 4a87375f1019f6d1434155d20d45ba17d8bb9ea5 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Fri, 26 Apr 2013 20:00:11 -0400 Subject: [PATCH] [Http] HttpServerInterface Force HttpServerInterface on route Call controller on all events --- src/Ratchet/Http/HttpServer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ratchet/Http/HttpServer.php b/src/Ratchet/Http/HttpServer.php index b72fd98..9d306e7 100644 --- a/src/Ratchet/Http/HttpServer.php +++ b/src/Ratchet/Http/HttpServer.php @@ -34,9 +34,9 @@ class HttpServer implements MessageComponentInterface { * @param Ratchet\Http\HttpServerInterface * @param array */ - public function addRoute($name, $path, MessageComponentInterface $controller, $allowedOrigins = array()) { + public function addRoute($name, $path, HttpServerInterface $controller, $allowedOrigins = array()) { $this->_routes->add($name, new Route($path, array( - '_controller' => $controller + '_controller' => $controller , 'allowedOrigins' => $allowedOrigins ))); } @@ -87,7 +87,7 @@ class HttpServer implements MessageComponentInterface { */ public function onClose(ConnectionInterface $conn) { if ($conn->Http->headers) { - $this->_decorating->onClose($conn); + $conn->Http->controller->onClose($conn); } } @@ -96,7 +96,7 @@ class HttpServer implements MessageComponentInterface { */ public function onError(ConnectionInterface $conn, \Exception $e) { if ($conn->Http->headers) { - $this->_decorating->onError($conn, $e); + $conn->Http->controller->onError($conn, $e); } else { $conn->close(); }