Merge pull request #1080 from channelcat/1079

fix timeout bug when self.transport is None
This commit is contained in:
Raphael Deem 2018-01-04 15:01:40 -08:00 committed by GitHub
commit 0e7e2f4e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,7 +431,10 @@ class HttpProtocol(asyncio.Protocol):
if self.parser and (self.keep_alive
or getattr(response, 'status', 0) == 408):
self.log_response(response)
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):
if from_error or self.transport.is_closing():