From 68d7328918ff529cddd8485766f905df0d15885f Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 2 May 2019 12:20:49 -0300 Subject: [PATCH] always close the write handle --- lbrynet/blob_exchange/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lbrynet/blob_exchange/client.py b/lbrynet/blob_exchange/client.py index 52c9dd537..67ca75cae 100644 --- a/lbrynet/blob_exchange/client.py +++ b/lbrynet/blob_exchange/client.py @@ -168,6 +168,10 @@ class BlobExchangeClientProtocol(asyncio.Protocol): except asyncio.CancelledError: self.close() raise + finally: + if self.writer and not self.writer.closed(): + self.writer.close_handle() + self.writer = None def connection_made(self, transport: asyncio.Transport): self.transport = transport