Skip to content

Commit

Permalink
Merge pull request #976 from ashleysommer/fix_websocket_timeout
Browse files Browse the repository at this point in the history
Fix Websocket protocol timeouts after #939
  • Loading branch information
r0fls authored Oct 19, 2017
2 parents 0a411f9 + ea5b07f commit 666c084
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions sanic/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ def __init__(self, *args, websocket_max_size=None,
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:
Expand Down

0 comments on commit 666c084

Please sign in to comment.