fixed web seed performance issue whith pieces > 1 MiB

This commit is contained in:
Arvid Norberg 2012-04-14 23:36:16 +00:00
parent b491a76159
commit dafcf2c5ca
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,5 @@
* fixed web seed performance issue whith pieces > 1 MiB
* fixed unchoke logic when using web seeds
* fixed compatibility with older versions of boost (down to boost 1.40)

View File

@ -84,9 +84,10 @@ namespace libtorrent
shared_ptr<torrent> tor = t.lock();
TORRENT_ASSERT(tor);
// we always prefer downloading 1 MB chunks
// from web seeds
prefer_whole_pieces((1024 * 1024) / tor->torrent_file().piece_length());
// we always prefer downloading 1 MiB chunks
// from web seeds, or whole pieces if pieces
// are larger than a MiB
prefer_whole_pieces((std::min)((1024 * 1024) / tor->torrent_file().piece_length(), 1));
// we want large blocks as well, so
// we can request more bytes at once