mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-16 10:01:14 -04:00
Fix Uninitilized Peer Max Rates.
When called by /libretroshare/src/pqi/pqihandler.cc:140
This commit is contained in:
parent
66bf1884a8
commit
8884a324bb
2 changed files with 29 additions and 25 deletions
|
@ -2080,19 +2080,24 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
|||
|
||||
bool p3PeerMgrIMPL::getMaxRates(const RsPeerId& pid,uint32_t& maxUp,uint32_t& maxDn)
|
||||
{
|
||||
RsPgpId pgp_id ;
|
||||
|
||||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
std::map<RsPeerId, peerState>::const_iterator it = mFriendList.find(pid) ;
|
||||
|
||||
if(it == mFriendList.end())
|
||||
return false ;
|
||||
|
||||
pgp_id = it->second.gpg_id ;
|
||||
}
|
||||
return getMaxRates(pgp_id,maxUp,maxDn) ;
|
||||
RsPgpId pgp_id ;
|
||||
|
||||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
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) ;
|
||||
}
|
||||
|
||||
bool p3PeerMgrIMPL::getMaxRates(const RsPgpId& pid,uint32_t& maxUp,uint32_t& maxDn)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue