From 7519e6bf8f1013c24b17c2be0d59753146a65354 Mon Sep 17 00:00:00 2001 From: Gourav Kandoria Date: Tue, 29 Aug 2023 23:36:25 +0530 Subject: [PATCH] "Remove checking of PONG event after receiving data" As websockets sansio protocol is not propagating this event after receiving data --- uvicorn/protocols/websockets/websockets_sansio_impl.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/uvicorn/protocols/websockets/websockets_sansio_impl.py b/uvicorn/protocols/websockets/websockets_sansio_impl.py index 6e93fffe2..110c96fd1 100644 --- a/uvicorn/protocols/websockets/websockets_sansio_impl.py +++ b/uvicorn/protocols/websockets/websockets_sansio_impl.py @@ -138,8 +138,6 @@ def handle_events(self) -> None: self.handle_bytes(event) elif event.opcode == Opcode.PING: self.handle_ping(event) - elif event.opcode == Opcode.PONG: - self.handle_pong(event) elif event.opcode == Opcode.CLOSE: self.handle_close(event) @@ -217,9 +215,6 @@ def handle_ping(self, event: Frame) -> None: output = self.conn.data_to_send() self.transport.writelines(output) - def handle_pong(self, event: Frame) -> None: - pass - def handle_close(self, event: Frame) -> None: if not self.close_sent and not self.transport.is_closing(): disconnect_event: WebSocketDisconnectEvent = {