async def finish_response(
        self, request: BaseRequest, resp: StreamResponse, start_time: float
    ) -> bool:
        """Prepare the response and write_eof, then log access.

        This has to
        be called within the context of any exception so the access logger
        can get exception information. Returns True if the client disconnects
        prematurely.
        """
        if self._request_parser is not None:
            self._request_parser.set_upgraded(False)
            self._upgrade = False
            if self._message_tail:
                self._request_parser.feed_data(self._message_tail)
                self._message_tail = b""
        try:
            prepare_meth = resp.prepare
        except AttributeError:
            if resp is None:
                raise RuntimeError("Missing return " "statement on request handler")
            else:
                raise RuntimeError(
                    "Web-handler should return "
                    "a response instance, "
                    "got {!r}".format(resp)
                )
        try:
            await prepare_meth(request)
            await resp.write_eof()
        except ConnectionError:
            self.log_access(request, resp, start_time)
            return True
        else:
            self.log_access(request, resp, start_time)
            return False
Prepare the response and write_eof, then log access.

        This has to
        be called within the context of any exception so the access logger
        can get exception information. Returns True if the client disconnects
        prematurely.
        
lib/aiohttp/web_protocol.py