Ticket #601: ticket-601-ratelimit-non-streaming-producer.patch
File ticket-601-ratelimit-non-streaming-producer.patch, 1.6 KB (added by , 10 years ago) |
---|
-
twisted/protocols/policies.py
217 217 self.transport.resumeProducing() 218 218 219 219 def throttleWrites(self): 220 if hasattr(self, "producer"): 221 self.producer.pauseProducing() 220 if hasattr(self, "producer") and self.producer is not None: 221 self.transport.producerPaused = 1 222 if hasattr(self.producer, 'pauseProducing'): 223 self.producer.pauseProducing() 222 224 223 225 def unthrottleWrites(self): 224 if hasattr(self, "producer"): 226 if hasattr(self, "producer") and self.producer is not None: 227 self.transport.producerPaused = 0 225 228 self.producer.resumeProducing() 226 229 227 230 -
twisted/internet/abstract.py
252 252 self.stopWriting() 253 253 # If I've got a producer who is supposed to supply me with data, 254 254 if self.producer is not None and ((not self.streamingProducer) 255 or self.producerPaused): 255 and not self.producerPaused 256 or self.streamingProducer 257 and self.producerPaused): 256 258 # tell them to supply some more. 257 259 self.producerPaused = 0 258 260 self.producer.resumeProducing()