

def clearBuffer(self):
    if (self.shouldLose == (- 1)):
        return
    if self.producer:
        self.producer.resumeProducing()
    if self.buffer:
        if self.logFile:
            self.logFile.write(('loopback receiving %s\n' % repr(self.buffer)))
        buffer = self.buffer
        self.buffer = ''
        self.target.dataReceived(buffer)
    if (self.shouldLose == 1):
        self.shouldLose = (- 1)
        self.target.connectionLost(failure.Failure(main.CONNECTION_DONE))

dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/protocols/loopback.py LoopbackRelay.clearBuffer/original