Yield data after registration.

This commit is contained in:
Yuxin Wang 2018-10-13 19:04:45 -04:00
parent 0aa2b16e3c
commit 17e61a34c4

View file

@ -200,8 +200,6 @@ class DownloadManager:
self._read_tasks[asyncio.ensure_future(read_message(reader))] = peer_address
continue
yield number, raw_data
# remove successfully-received chunk from pending and download plans
del self._file_chunk_info[number]
del self._pending_chunknum[number]
@ -217,6 +215,8 @@ class DownloadManager:
# stop querying tracker
pass
yield number, raw_data
# send out request chunk
if len(self._to_download_chunk) > 0:
chunknum = self._to_download_chunk.pop(0)