From 1ea0bd32559a3dd3084172a6616daee7a3a64bb9 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sat, 27 Apr 2013 16:51:24 -0400 Subject: [PATCH] [Http] Cleanup and parse error fix --- src/Ratchet/Http/HttpServer.php | 15 ++++++--------- .../bin/fuzzingserver-noutf8.php | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Ratchet/Http/HttpServer.php b/src/Ratchet/Http/HttpServer.php index 867d008..d4e8967 100644 --- a/src/Ratchet/Http/HttpServer.php +++ b/src/Ratchet/Http/HttpServer.php @@ -3,13 +3,10 @@ namespace Ratchet\Http; use Ratchet\MessageComponentInterface; use Ratchet\ConnectionInterface; use Guzzle\Http\Message\Response; -use Symfony\Component\Routing\RouteCollection; -use Symfony\Component\Routing\Route; -use Symfony\Component\Routing\RequestContext; -use Symfony\Component\Routing\Matcher\UrlMatcher; -use Symfony\Component\Routing\Exception\MethodNotAllowedException; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; +/** + * @todo Detect HTTP proxy header IP, re-map remoteAddress + */ class HttpServer implements MessageComponentInterface { /** * Buffers incoming HTTP requests returning a Guzzle Request when coalesced @@ -26,8 +23,8 @@ class HttpServer implements MessageComponentInterface { /** * @param HttpServerInterface */ - public function __construct(HttpServerInterface $server) { - $this->_httpServer = $server; + public function __construct(HttpServerInterface $component) { + $this->_httpServer = $component; $this->_reqParser = new HttpRequestParser; } @@ -83,7 +80,7 @@ class HttpServer implements MessageComponentInterface { * Close a connection with an HTTP response * @param \Ratchet\ConnectionInterface $conn * @param int $code HTTP status code - * @return void + * @return null */ protected function close(ConnectionInterface $conn, $code = 400) { $response = new Response($code, array( diff --git a/tests/AutobahnTestSuite/bin/fuzzingserver-noutf8.php b/tests/AutobahnTestSuite/bin/fuzzingserver-noutf8.php index f63893a..b20b3a1 100644 --- a/tests/AutobahnTestSuite/bin/fuzzingserver-noutf8.php +++ b/tests/AutobahnTestSuite/bin/fuzzingserver-noutf8.php @@ -4,7 +4,7 @@ $loop = new React\EventLoop\StreamSelectLoop; $sock = new React\Socket\Server($loop); - $web = new Ratchet\WebSocket\WsServer(new Ratchet\Tests\AbFuzzyServer) + $web = new Ratchet\WebSocket\WsServer(new Ratchet\Tests\AbFuzzyServer); $app = new Ratchet\Http\HttpServer($web); $web->setEncodingChecks(false);