From 6e5e590ef6d34a2cdbc04bbc493d34e482db1d77 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Wed, 20 May 2020 19:25:31 +0900 Subject: [PATCH] [QuicTransport] Address comments in pull/22844 (#23705) * [QuicTransport] Address comments in pull/22844 Address comments provided in https://github.com/web-platform-tests/wpt/pull/22844. --- tools/quic/quic_transport_server.py | 4 +++- webtransport/quic/handlers/client-indication.quic.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/quic/quic_transport_server.py b/tools/quic/quic_transport_server.py index 10d81743693b43..9a04ad17f195c6 100644 --- a/tools/quic/quic_transport_server.py +++ b/tools/quic/quic_transport_server.py @@ -56,9 +56,11 @@ def quic_event_received(self, event: QuicEvent) -> None: isinstance(event, StreamDataReceived) and event.stream_id == 2): # client indication process + prefix = 'Client indication error: ' self.client_indication_data += event.data + if len(self.client_indication_data) > 65535: + raise Exception('too large data for client indication') if event.end_stream: - prefix = 'Client inditation error: ' self.process_client_indication() if self.is_closing_or_closed(): return diff --git a/webtransport/quic/handlers/client-indication.quic.py b/webtransport/quic/handlers/client-indication.quic.py index da0701cc04b17b..56238c7514c065 100644 --- a/webtransport/quic/handlers/client-indication.quic.py +++ b/webtransport/quic/handlers/client-indication.quic.py @@ -12,6 +12,9 @@ async def notify_pass(connection: QuicConnectionProtocol): writer.write_eof() +# Verifies that the client indication sent by the client is correct. Creates +# a unidirectional stream containing "PASS" when the check finishes +# sucessfully. def handle_client_indication(connection: QuicConnectionProtocol, origin: str, query: Dict[str, str]): logging.log(logging.INFO, 'origin = %s, query = %s' % (origin, query))