From ea5b07f636451822cbe923a75e6275118f594006 Mon Sep 17 00:00:00 2001 From: Ashley Sommer Date: Mon, 16 Oct 2017 11:05:01 +1000 Subject: [PATCH] Update websocket protocol to accomodate changes in HTTP protocol from https://github.com/channelcat/sanic/pull/939 Fixes https://github.com/channelcat/sanic/issues/969 --- sanic/websocket.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sanic/websocket.py b/sanic/websocket.py index e8e9922f..37b13f3c 100644 --- a/sanic/websocket.py +++ b/sanic/websocket.py @@ -13,10 +13,18 @@ class WebSocketProtocol(HttpProtocol): self.websocket_max_size = websocket_max_size self.websocket_max_queue = websocket_max_queue - def connection_timeout(self): - # timeouts make no sense for websocket routes + # timeouts make no sense for websocket routes + def request_timeout_callback(self): if self.websocket is None: - super().connection_timeout() + super().request_timeout_callback() + + def response_timeout_callback(self): + if self.websocket is None: + super().response_timeout_callback() + + def keep_alive_timeout_callback(self): + if self.websocket is None: + super().keep_alive_timeout_callback() def connection_lost(self, exc): if self.websocket is not None: