fix timeout bug when self.transport is None

This commit is contained in:
r0fls 2018-01-03 23:33:22 -08:00
parent ca0bc1cb7d
commit 46521240a9

View File

@ -431,7 +431,10 @@ class HttpProtocol(asyncio.Protocol):
if self.parser and (self.keep_alive if self.parser and (self.keep_alive
or getattr(response, 'status', 0) == 408): or getattr(response, 'status', 0) == 408):
self.log_response(response) self.log_response(response)
self.transport.close() try:
self.transport.close()
except AttributeError as e:
logger.debug('Connection lost before server could close it.')
def bail_out(self, message, from_error=False): def bail_out(self, message, from_error=False):
if from_error or self.transport.is_closing(): if from_error or self.transport.is_closing():