make sure we don't download pieces while the torrent is checking

This commit is contained in:
Arvid Norberg 2012-04-24 18:43:56 +00:00
parent 49f74be42f
commit 4ae349f61f
1 changed files with 7 additions and 0 deletions

View File

@ -3292,6 +3292,13 @@ namespace libtorrent
return;
}
// we can't download pieces in these states
if (t->state() == torrent_status::checking_files
|| t->state() == torrent_status::checking_resume_data
|| t->state() == torrent_status::downloading_metadata
|| t->state() == torrent_status::allocating)
return;
if ((int)m_download_queue.size() >= m_desired_queue_size
|| t->upload_mode()) return;