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 8254c9cbf2d2b6ab23d41873ebe50a06bcef23ea..3c84c149b3c38dd1317b46031fddf0b602da6e33 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)