mirror of
https://github.com/django/daphne.git
synced 2025-07-14 18:02:17 +03:00
Fix crash when non-handshaked websocket closes
This commit is contained in:
parent
423e3125ed
commit
7a99995eb8
|
@ -60,11 +60,12 @@ class InterfaceProtocol(WebSocketServerProtocol):
|
||||||
self.sendClose()
|
self.sendClose()
|
||||||
|
|
||||||
def onClose(self, wasClean, code, reason):
|
def onClose(self, wasClean, code, reason):
|
||||||
del self.factory.protocols[self.send_channel]
|
if hasattr(self, "send_channel"):
|
||||||
Channel("django.websocket.disconnect").send(
|
del self.factory.protocols[self.send_channel]
|
||||||
send_channel = self.send_channel,
|
Channel("django.websocket.disconnect").send(
|
||||||
**self.request_info
|
send_channel = self.send_channel,
|
||||||
)
|
**self.request_info
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class InterfaceFactory(WebSocketServerFactory):
|
class InterfaceFactory(WebSocketServerFactory):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user