mirror of
https://github.com/django/daphne.git
synced 2024-11-22 16:06:34 +03:00
Fixed #93: Don't try to send disconnect if it never connected
This commit is contained in:
parent
3cd048d594
commit
d86d7dd3c4
|
@ -190,13 +190,15 @@ class WebRequest(http.Request):
|
||||||
Sends a disconnect message on the http.disconnect channel.
|
Sends a disconnect message on the http.disconnect channel.
|
||||||
Useful only really for long-polling.
|
Useful only really for long-polling.
|
||||||
"""
|
"""
|
||||||
try:
|
# If we don't yet have a path, then don't send as we never opened.
|
||||||
self.factory.channel_layer.send("http.disconnect", {
|
if self.path:
|
||||||
"reply_channel": self.reply_channel,
|
try:
|
||||||
"path": self.unquote(self.path),
|
self.factory.channel_layer.send("http.disconnect", {
|
||||||
})
|
"reply_channel": self.reply_channel,
|
||||||
except self.factory.channel_layer.ChannelFull:
|
"path": self.unquote(self.path),
|
||||||
pass
|
})
|
||||||
|
except self.factory.channel_layer.ChannelFull:
|
||||||
|
pass
|
||||||
|
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user