Merge pull request #2285 from jolavillette/pqihandler-bwctrl-bugfix

Fix bug in pqihandler preventing UP BW management when bwctrl service is OFF
This commit is contained in:
csoler 2021-02-08 09:49:58 +01:00 committed by GitHub
commit 8e64a07efc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -470,18 +470,11 @@ int pqihandler::UpdateRates()
// for our up bandwidth we take into account the max down provided by peers via BwCtrl
// because we don't want to clog our outqueues, the TCP buffers, and the peers inbound queues
mod -> pqi -> setMaxRate(false, out_max_bw);
if ((rateMap_it = rateMap.find(mod->pqi->PeerId())) != rateMap.end())
{
if (rateMap_it->second.mAllowedOut > 0)
{
if (out_max_bw > rateMap_it->second.mAllowedOut)
mod -> pqi -> setMaxRate(false, rateMap_it->second.mAllowedOut);
else
mod -> pqi -> setMaxRate(false, out_max_bw);
}
else
mod -> pqi -> setMaxRate(false, out_max_bw);
}
}
#ifdef UPDATE_RATES_DEBUG