From 94ec4f682c30f8e8cdebc22bf69d40779ab4891e Mon Sep 17 00:00:00 2001 From: ElRoberto538 Date: Fri, 2 Jun 2017 21:27:37 +1200 Subject: [PATCH] Renamed websocket handshake timeout variable --- daphne/http_protocol.py | 4 ++-- daphne/server.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/daphne/http_protocol.py b/daphne/http_protocol.py index 694bc22..f318629 100755 --- a/daphne/http_protocol.py +++ b/daphne/http_protocol.py @@ -308,7 +308,7 @@ class HTTPFactory(http.HTTPFactory): routed appropriately. """ - def __init__(self, channel_layer, action_logger=None, send_channel=None, timeout=120, websocket_timeout=86400, ping_interval=20, ping_timeout=30, ws_protocols=None, root_path="", websocket_connect_timeout=30, proxy_forwarded_address_header=None, proxy_forwarded_port_header=None, ws_open_handshake_timeout=5): + def __init__(self, channel_layer, action_logger=None, send_channel=None, timeout=120, websocket_timeout=86400, ping_interval=20, ping_timeout=30, ws_protocols=None, root_path="", websocket_connect_timeout=30, proxy_forwarded_address_header=None, proxy_forwarded_port_header=None, websocket_handshake_timeout=5): http.HTTPFactory.__init__(self) self.channel_layer = channel_layer self.action_logger = action_logger @@ -327,7 +327,7 @@ class HTTPFactory(http.HTTPFactory): self.ws_factory.setProtocolOptions( autoPingTimeout=ping_timeout, allowNullOrigin=True, - openHandshakeTimeout=ws_open_handshake_timeout + openHandshakeTimeout=websocket_handshake_timeout ) self.ws_factory.protocol = WebSocketProtocol self.ws_factory.reply_protocols = self.reply_protocols diff --git a/daphne/server.py b/daphne/server.py index 4631cf6..20b19cb 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -38,7 +38,7 @@ class Server(object): proxy_forwarded_port_header=None, force_sync=False, verbosity=1, - ws_open_handshake_timeout=5 + websocket_handshake_timeout=5 ): self.channel_layer = channel_layer self.endpoints = endpoints or [] @@ -70,7 +70,7 @@ class Server(object): # channel layer's group_expiry value if present, or one day if not. self.websocket_timeout = websocket_timeout or getattr(channel_layer, "group_expiry", 86400) self.websocket_connect_timeout = websocket_connect_timeout - self.ws_open_handshake_timeout = ws_open_handshake_timeout + self.websocket_handshake_timeout = websocket_handshake_timeout self.ws_protocols = ws_protocols self.root_path = root_path self.force_sync = force_sync @@ -95,7 +95,7 @@ class Server(object): root_path=self.root_path, proxy_forwarded_address_header=self.proxy_forwarded_address_header, proxy_forwarded_port_header=self.proxy_forwarded_port_header, - ws_open_handshake_timeout=self.ws_open_handshake_timeout + websocket_handshake_timeout=self.websocket_handshake_timeout ) if self.verbosity <= 1: # Redirect the Twisted log to nowhere