*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-02-01 16:48:59 +00:00
parent 5239df3f0e
commit 803a65bff9
2 changed files with 4 additions and 4 deletions

View File

@ -89,9 +89,9 @@ namespace
, peer_connection& c
, std::vector<peer_connection*> ignore = std::vector<peer_connection*>())
{
float time_for_last_piece = to_seconds(c.last_piece_time());
if (time_for_last_piece == 0) time_for_last_piece = 0.001f;
const float rate = 1.f / time_for_last_piece;
float piece_time = to_seconds(c.last_piece_time());
if (piece_time == 0) piece_time = 0.00001f;
const float rate = 1.f / piece_time;
// this will make the number of requests linearly dependent
// on the rate in which we download from the peer. 2.5kB/s and

View File

@ -250,7 +250,7 @@ namespace libtorrent
std::random_shuffle(pieces.begin(), pieces.end());
std::random_shuffle(targets.begin(), targets.end());
for (int i = 0; i < num_pieces / 4; ++i)
for (int i = 0; i < std::max(num_pieces / 100, 1); ++i)
{
const int slot_index = targets[i];
const int piece_index = pieces[i];