From: Cameron Dale Date: Wed, 27 Feb 2008 07:05:00 +0000 (-0800) Subject: Only use the ThrottlingProtocol if the producer is streaming. X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=commitdiff_plain;h=f42a072b964146fcfb47c5235a29f155074b57e7 Only use the ThrottlingProtocol if the producer is streaming. --- diff --git a/apt_dht/policies.py b/apt_dht/policies.py index 8254c9c..3c84c14 100644 --- a/apt_dht/policies.py +++ b/apt_dht/policies.py @@ -159,6 +159,7 @@ class ThrottlingProtocol(ProtocolWrapper): ProtocolWrapper.dataReceived(self, data) def registerProducer(self, producer, streaming): + assert streaming, "You can only use the ThrottlingProtocol with streaming (push) producers." self.producer = producer ProtocolWrapper.registerProducer(self, producer, streaming)