mirror of
https://github.com/django/daphne.git
synced 2025-07-27 15:39:46 +03:00
This fixes the following exception I was seeing in my logs:
Nov 27 13:20:47 python3[28665]: File "/var/lib/wwwrun/.virtualenvs//lib/python3.6/site-packages/channels/consumer.py", line 81, in send Nov 27 13:20:47 python3[28665]: await self.base_send(message) Nov 27 13:20:47 python3[28665]: File "/var/lib/wwwrun/.virtualenvs//lib/python3.6/site-packages/channels/sessions.py", line 232, in send Nov 27 13:20:47 python3[28665]: return await self.real_send(message) Nov 27 13:20:47 python3[28665]: File "/var/lib/wwwrun/.virtualenvs//lib/python3.6/site-packages/daphne/server.py", line 213, in handle_reply Nov 27 13:20:47 python3[28665]: if self.connections[protocol].get("disconnected", None): Nov 27 13:20:47 python3[28665]: KeyError: <WebSocketProtocol client=None path=b'/vnc/devices/'>
This commit is contained in:
parent
44b7115db7
commit
4d1b87ee42
|
@ -210,7 +210,7 @@ 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):
|
||||
if protocol not in self.connections or self.connections[protocol].get("disconnected"):
|
||||
return
|
||||
self.check_headers_type(message)
|
||||
# Let the protocol handle it
|
||||
|
|
Loading…
Reference in New Issue
Block a user