mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 17:51:26 -05:00
Fix Uninitilized Peer Max Rates.
When called by /libretroshare/src/pqi/pqihandler.cc:140
This commit is contained in:
parent
66bf1884a8
commit
8884a324bb
@ -2088,10 +2088,15 @@ bool p3PeerMgrIMPL::getMaxRates(const RsPeerId& pid,uint32_t& maxUp,uint32_t& ma
|
||||
std::map<RsPeerId, peerState>::const_iterator it = mFriendList.find(pid) ;
|
||||
|
||||
if(it == mFriendList.end())
|
||||
{
|
||||
maxUp = 0;
|
||||
maxDn = 0;
|
||||
return false ;
|
||||
}
|
||||
|
||||
pgp_id = it->second.gpg_id ;
|
||||
}
|
||||
|
||||
return getMaxRates(pgp_id,maxUp,maxDn) ;
|
||||
}
|
||||
|
||||
|
@ -136,9 +136,8 @@ int pqihandler::tick()
|
||||
{
|
||||
// This is rather inelegant, but pqihandler has searchModules that are dynamically allocated, so the max rates
|
||||
// need to be updated from inside.
|
||||
uint32_t maxUp,maxDn ;
|
||||
rsPeers->getPeerMaximumRates(it->first,maxUp,maxDn);
|
||||
|
||||
uint32_t maxUp = 0,maxDn =0 ;
|
||||
if (rsPeers->getPeerMaximumRates(it->first,maxUp,maxDn) )
|
||||
it->second->pqi->setRateCap(maxDn,maxUp);// mind the order! Dn first, than Up.
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user