close blob server transport on sendfile failing

This commit is contained in:
Jack Robison 2019-02-01 11:38:10 -05:00
parent 3eac99c509
commit 0a08f445a4
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -61,6 +61,8 @@ class BlobServerProtocol(asyncio.Protocol):
try: try:
sent = await blob.sendfile(self) sent = await blob.sendfile(self)
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError): except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError):
if self.transport:
self.transport.close()
return return
log.info("sent %s (%i bytes) to %s:%i", blob.blob_hash[:8], sent, peer_address, peer_port) log.info("sent %s (%i bytes) to %s:%i", blob.blob_hash[:8], sent, peer_address, peer_port)
if responses: if responses: