From 441c4de1e39e7ab01595519055b7fd5641a5d891 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Thu, 23 Aug 2007 16:55:25 +0000 Subject: [PATCH] rate limiter fix from lt --- libtorrent/include/libtorrent/bandwidth_manager.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libtorrent/include/libtorrent/bandwidth_manager.hpp b/libtorrent/include/libtorrent/bandwidth_manager.hpp index b0ff342a4..6c840d5a3 100644 --- a/libtorrent/include/libtorrent/bandwidth_manager.hpp +++ b/libtorrent/include/libtorrent/bandwidth_manager.hpp @@ -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) { @@ -463,3 +462,4 @@ private: #endif +