Merge pull request #1840 from lbryio/close-transport-on-sendfile-fail

close blob server transport on sendfile failing
This commit is contained in:
Jack Robison 2019-02-01 15:13:07 -05:00 committed by GitHub
commit 4e3b529aec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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: