def requestDone(self, request):
        """
        Called by first request in queue when it is done.
        """
        if request != self.requests[0]: raise TypeError
        del self.requests[0]

        # We should only resume the producer if we're not waiting for the
        # transport.
        if not self._waitingForTransport:
            self._networkProducer.resumeProducing()

        if self.persistent:
            self._handlingRequest = False

            if self._savedTimeOut:
                self.setTimeout(self._savedTimeOut)

            # Receive our buffered data, if any.
            data = b''.join(self._dataBuffer)
            self._dataBuffer = []
            self.setLineMode(data)
        else:
            self.loseConnection()

        Called by first request in queue when it is done.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/http.py