From c23e971091dc63a016c5f9f3c2dfef3eaf5dea92 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Fri, 16 Feb 2024 00:10:09 +0100 Subject: [PATCH] Remove unnecessary getApplicationLayerProtocols() method from HttpDriverMiddleware --- src/Driver/HttpDriverMiddleware.php | 5 ----- src/SocketHttpServer.php | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Driver/HttpDriverMiddleware.php b/src/Driver/HttpDriverMiddleware.php index 7467160a..5fc3209c 100644 --- a/src/Driver/HttpDriverMiddleware.php +++ b/src/Driver/HttpDriverMiddleware.php @@ -13,9 +13,4 @@ public function createHttpDriver( ErrorHandler $errorHandler, Client $client, ): HttpDriver; - - /** - * @return list - */ - public function getApplicationLayerProtocols(HttpDriverMiddleware $next): array; } diff --git a/src/SocketHttpServer.php b/src/SocketHttpServer.php index 398c411f..cba25068 100644 --- a/src/SocketHttpServer.php +++ b/src/SocketHttpServer.php @@ -197,8 +197,8 @@ public function expose(SocketAddress|string $socketAddress, BindContext|QuicServ $socketAddress = SocketAddress\fromString($socketAddress); } - $name = $socketAddress->toString(); - if (isset($this->addresses[$name]) && ($bindContext instanceof QuicServerConfig) == ($this->addresses[$name][1] instanceof QuicServerConfig)) { + $name = ($bindContext instanceof QuicServerConfig ? "quic-" : "") . $socketAddress->toString(); + if (isset($this->addresses[$name])) { throw new \Error(\sprintf('Already exposing %s on HTTP server', $name)); }