From f42a072b964146fcfb47c5235a29f155074b57e7 Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Tue, 26 Feb 2008 23:05:00 -0800 Subject: [PATCH] Only use the ThrottlingProtocol if the producer is streaming. --- apt_dht/policies.py | 1 + 1 file changed, 1 insertion(+) 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) -- 2.39.5