Ticket #5562: ticket5562_abstract.py.patch

File ticket5562_abstract.py.patch, 1.1 KB (added by dynamicgl, 22 months ago)
  • twisted/internet/iocpreactor/abstract.py

     
    152152    _writeDisconnecting = False 
    153153    _writeDisconnected = False 
    154154    writeBufferSize = 2**2**2**2 
     155    _doWriteCalling = False 
    155156 
    156157 
    157158    def loseWriteConnection(self): 
     
    186187 
    187188    def _resumeWriting(self): 
    188189        self._writeScheduled = None 
    189         self.doWrite() 
     190        if self._doWriteCalling: 
     191            self.reactor.callLater(0, self._resumeWriting) 
     192        else: 
     193            self.doWrite() 
    190194 
    191195 
    192196    def _cbWrite(self, rc, bytes, evt): 
     197        self._doWriteCalling = False 
    193198        if self._handleWrite(rc, bytes, evt): 
    194199            self.doWrite() 
    195200 
     
    235240 
    236241 
    237242    def doWrite(self): 
     243        self._doWriteCalling = True 
    238244        if len(self.dataBuffer) - self.offset < self.SEND_LIMIT: 
    239245            # If there is currently less than SEND_LIMIT bytes left to send 
    240246            # in the string, extend it with the array data.