cancel task when connection_lost

This commit is contained in:
Yun Xu 2018-10-11 22:38:26 -07:00
parent 4cb107aedc
commit 36032cc26e

View File

@ -120,6 +120,10 @@ class HttpProtocol(asyncio.Protocol):
def connection_lost(self, exc):
self.connections.discard(self)
if self._request_handler_task:
self._request_handler_task.cancel()
if self._request_stream_task:
self._request_stream_task.cancel()
if self._request_timeout_handler:
self._request_timeout_handler.cancel()
if self._response_timeout_handler: