fixed error handling with torrents with invalid piece sizes

This commit is contained in:
Arvid Norberg
2010-02-22 01:51:25 +00:00
parent b96e0a448e
commit 210c663596
6 changed files with 20 additions and 6 deletions

View File

@@ -474,6 +474,7 @@ namespace libtorrent
TORRENT_ASSERT(m_seeds >= 0);
const int num_pieces = m_piece_map.size();
if (num_pieces == 0) return std::make_pair(1, 0);
int min_availability = piece_pos::max_peer_count;
// find the lowest availability count
// count the number of pieces that have that availability