Only use the ThrottlingProtocol if the producer is streaming.
authorCameron Dale <camrdale@gmail.com>
Wed, 27 Feb 2008 07:05:00 +0000 (23:05 -0800)
committerCameron Dale <camrdale@gmail.com>
Wed, 27 Feb 2008 07:05:00 +0000 (23:05 -0800)
apt_dht/policies.py

index 8254c9c..3c84c14 100644 (file)
@@ -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)