From ffc7fc0793ef93607b574f2366c57d3828f6b407 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 30 Jan 2019 12:03:05 -0500 Subject: [PATCH] fix uncaught exception in BlobServerProtocol when client disconnects during a blob transfer --- lbrynet/blob_exchange/server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lbrynet/blob_exchange/server.py b/lbrynet/blob_exchange/server.py index 050afb7c9..b77fd40a4 100644 --- a/lbrynet/blob_exchange/server.py +++ b/lbrynet/blob_exchange/server.py @@ -58,7 +58,10 @@ class BlobServerProtocol(asyncio.Protocol): responses.append(BlobDownloadResponse(incoming_blob=incoming_blob)) self.send_response(responses) log.info("send %s to %s:%i", blob.blob_hash[:8], peer_address, peer_port) - sent = await blob.sendfile(self) + try: + sent = await blob.sendfile(self) + except ConnectionResetError: + return log.info("sent %s (%i bytes) to %s:%i", blob.blob_hash[:8], sent, peer_address, peer_port) if responses: self.send_response(responses)