fixed bug with the bandwidth throttling

This commit is contained in:
Arvid Norberg 2006-09-21 16:34:21 +00:00
parent 4edfaa0493
commit 978fe778ec
1 changed files with 2 additions and 0 deletions

View File

@ -60,6 +60,8 @@ namespace libtorrent
{
assert(given <= max);
assert(given >= min);
if (used < 0 && (given - used < 0))
return boost::integer_traits<int>::const_max;
return given - used;
}