fix hanging download
This commit is contained in:
parent
aa7f0845cc
commit
40b90ce79b
2 changed files with 1 additions and 2 deletions
|
@ -120,8 +120,6 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
||||||
self._response_fut.cancel()
|
self._response_fut.cancel()
|
||||||
if self.writer and not self.writer.closed():
|
if self.writer and not self.writer.closed():
|
||||||
self.writer.close_handle()
|
self.writer.close_handle()
|
||||||
if self.blob:
|
|
||||||
await self.blob.close()
|
|
||||||
self._response_fut = None
|
self._response_fut = None
|
||||||
self.writer = None
|
self.writer = None
|
||||||
self.blob = None
|
self.blob = None
|
||||||
|
|
|
@ -82,6 +82,7 @@ class BlobDownloader:
|
||||||
peer, task = self.active_connections.popitem()
|
peer, task = self.active_connections.popitem()
|
||||||
if task and not task.done():
|
if task and not task.done():
|
||||||
task.cancel()
|
task.cancel()
|
||||||
|
await blob.close()
|
||||||
return blob
|
return blob
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
while self.active_connections:
|
while self.active_connections:
|
||||||
|
|
Loading…
Reference in a new issue