bandwidth management fix + improved string conversion fallback in case strings are incorrect in torrent

This commit is contained in:
Arvid Norberg
2007-02-19 23:06:20 +00:00
parent f5fe27e691
commit 4f86042b97
4 changed files with 18 additions and 5 deletions

View File

@@ -218,6 +218,10 @@ namespace libtorrent
t->expire_bandwidth(m_channel, -1);
continue;
}
// don't hand out chunks larger than the throttle
// per second on the torrent
if (max_assignable > t->bandwidth_throttle(m_channel))
max_assignable = t->bandwidth_throttle(m_channel);
// so, hand out max_assignable, but no more than
// the available bandwidth (amount) and no more