rate limiter fix

This commit is contained in:
Arvid Norberg 2007-08-23 16:49:59 +00:00
parent 9e2367fd13
commit cc54c242a1
1 changed files with 3 additions and 4 deletions

View File

@ -374,9 +374,8 @@ private:
// block size must be smaller for lower rates. This is because
// the history window is one second, and the block will be forgotten
// after one second.
int block_size = (std::min)(qe.max_block_size
, (std::min)(qe.peer->bandwidth_throttle(m_channel)
, m_limit / 10));
int block_size = (std::min)(qe.peer->bandwidth_throttle(m_channel)
, m_limit / 10);
if (block_size < min_bandwidth_block_size)
{
@ -398,8 +397,8 @@ private:
block_size = m_limit
/ (m_limit / max_bandwidth_block_size);
}
if (block_size > qe.max_block_size) block_size = qe.max_block_size;
}
if (block_size > qe.max_block_size) block_size = qe.max_block_size;
if (amount < block_size / 2)
{