'Called by first request in queue when it is done.'

def requestDone(self, request):

    if (request != self.requests[0]):
        raise TypeError
    del self.requests[0]
    if (not self._waitingForTransport):
        self._networkProducer.resumeProducing()
    if self.persistent:
        self._handlingRequest = False
        if self._savedTimeOut:
            self.setTimeout(self._savedTimeOut)
        data = ''.join(self._dataBuffer)
        self._dataBuffer = []
        self.setLineMode(data)
    else:
        self.loseConnection()
