From 40b90ce79b1793047e199a72e1e97b571892bae7 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 31 Jan 2019 16:53:27 -0500 Subject: [PATCH] fix hanging download --- lbrynet/blob_exchange/client.py | 2 -- lbrynet/blob_exchange/downloader.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lbrynet/blob_exchange/client.py b/lbrynet/blob_exchange/client.py index 8fbd19beb..749ee5e1f 100644 --- a/lbrynet/blob_exchange/client.py +++ b/lbrynet/blob_exchange/client.py @@ -120,8 +120,6 @@ class BlobExchangeClientProtocol(asyncio.Protocol): self._response_fut.cancel() if self.writer and not self.writer.closed(): self.writer.close_handle() - if self.blob: - await self.blob.close() self._response_fut = None self.writer = None self.blob = None diff --git a/lbrynet/blob_exchange/downloader.py b/lbrynet/blob_exchange/downloader.py index 84c4e3282..e808a9773 100644 --- a/lbrynet/blob_exchange/downloader.py +++ b/lbrynet/blob_exchange/downloader.py @@ -82,6 +82,7 @@ class BlobDownloader: peer, task = self.active_connections.popitem() if task and not task.done(): task.cancel() + await blob.close() return blob except asyncio.CancelledError: while self.active_connections: