Commit 10ebff9a authored by Michael Fladischer's avatar Michael Fladischer

Update upstream source from tag 'upstream/2.2.4'

Update to upstream version '2.2.4'
with Debian dir e7ff336cdcaf198910a9141c9eed2def606e93b5
parents bb2f12a1 daf1dd4a
2.2.4 (2018-12-15)
------------------
* No longer listens on port 8000 when a file descriptor is provided with --fixed
* Fixed a memory leak with WebSockets
2.2.3 (2018-11-06)
------------------
......
__version__ = "2.2.3"
__version__ = "2.2.4"
......@@ -226,7 +226,7 @@ class CommandLineInterface(object):
args.host,
args.port is not None,
args.unix_socket,
args.file_descriptor,
args.file_descriptor is not None,
args.socket_strings,
]
):
......
......@@ -176,7 +176,11 @@ class Server(object):
def protocol_disconnected(self, protocol):
# Set its disconnected time (the loops will come and clean it up)
self.connections[protocol]["disconnected"] = time.time()
# Do not set it if it is already set. Overwriting it might
# cause it to never be cleaned up.
# See https://github.com/django/channels/issues/1181
if "disconnected" not in self.connections[protocol]:
self.connections[protocol]["disconnected"] = time.time()
### Internal event/message handling
......@@ -208,8 +212,10 @@ class Server(object):
"""
Coroutine that jumps the reply message from asyncio to Twisted
"""
# Don't do anything if the connection is closed
if self.connections[protocol].get("disconnected", None):
# Don't do anything if the connection is closed or does not exist
if protocol not in self.connections or self.connections[protocol].get(
"disconnected", None
):
return
self.check_headers_type(message)
# Let the protocol handle it
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment