*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-02-01 17:26:09 +00:00
parent 803a65bff9
commit 1a198769cf
2 changed files with 4 additions and 8 deletions

View File

@ -89,10 +89,6 @@ namespace
, peer_connection& c
, std::vector<peer_connection*> ignore = std::vector<peer_connection*>())
{
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
// less will make the desired queue size 2 and at about 70 kB/s
@ -100,7 +96,7 @@ namespace
// matlab expression to plot:
// x = 1:100:100000; plot(x, round(min(max(x ./ 5000 + 1.5, 4), 16)));
int desired_queue_size = static_cast<int>(rate / 5000.f + 1.5f);
int desired_queue_size = static_cast<int>(c.statistics().download_rate() / 5000.f + 1.5f);
if (desired_queue_size > max_request_queue) desired_queue_size = max_request_queue;
if (desired_queue_size < min_request_queue) desired_queue_size = min_request_queue;
@ -179,7 +175,7 @@ namespace
continue;
const std::deque<piece_block>& queue = i->second->download_queue();
const int queue_size = i->second->download_queue().size();
const int queue_size = (int)i->second->download_queue().size();
const float weight = queue_size == 0
? std::numeric_limits<float>::max()
: i->second->statistics().down_peak() / queue_size;
@ -205,7 +201,7 @@ namespace
// this peer doesn't have a faster connection than the
// slowest peer. Don't take over any blocks
const int queue_size = c.download_queue().size();
const int queue_size = (int)c.download_queue().size();
const float weight = queue_size == 0
? std::numeric_limits<float>::max()
: c.statistics().down_peak() / queue_size;

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 < std::max(num_pieces / 100, 1); ++i)
for (int i = 0; i < std::max(num_pieces / 50, 1); ++i)
{
const int slot_index = targets[i];
const int piece_index = pieces[i];