mirror of
https://github.com/django/daphne.git
synced 2024-11-25 01:03:45 +03:00
Fix WebSockets to work with Twisted 17.1
Underlying PR that broke things: https://github.com/twisted/twisted/pull/591 We're relying on a private API so this is not really Twisted's fault.
This commit is contained in:
parent
9853bf1740
commit
b65140b158
|
@ -121,7 +121,11 @@ class WebRequest(http.Request):
|
|||
del self.factory.reply_protocols[self.reply_channel]
|
||||
self.reply_channel = None
|
||||
# Resume the producer so we keep getting data, if it's available as a method
|
||||
if hasattr(self.channel, "resumeProducing"):
|
||||
# 17.1 version
|
||||
if hasattr(self.channel, "_networkProducer"):
|
||||
self.channel._networkProducer.resumeProducing()
|
||||
# 16.x version
|
||||
elif hasattr(self.channel, "resumeProducing"):
|
||||
self.channel.resumeProducing()
|
||||
|
||||
# Boring old HTTP.
|
||||
|
|
Loading…
Reference in New Issue
Block a user