mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
moved node-wide options to node details
This commit is contained in:
parent
a4931edee0
commit
f5ad8b49be
10 changed files with 184 additions and 145 deletions
|
@ -2076,6 +2076,23 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
|||
return true;
|
||||
}
|
||||
|
||||
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) ;
|
||||
}
|
||||
|
||||
bool p3PeerMgrIMPL::getMaxRates(const RsPgpId& pid,uint32_t& maxUp,uint32_t& maxDn)
|
||||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
|
|
@ -211,6 +211,7 @@ virtual uint32_t getHiddenType(const RsPeerId &ssl_id) = 0;
|
|||
virtual int getFriendCount(bool ssl, bool online) = 0;
|
||||
virtual bool setMaxRates(const RsPgpId& pid,uint32_t maxR,uint32_t minR)=0;
|
||||
virtual bool getMaxRates(const RsPgpId& pid,uint32_t& maxR,uint32_t& minR)=0;
|
||||
virtual bool getMaxRates(const RsPeerId& pid,uint32_t& maxR,uint32_t& minR)=0;
|
||||
|
||||
/************* DEPRECIATED FUNCTIONS (TO REMOVE) ********/
|
||||
|
||||
|
@ -327,6 +328,7 @@ virtual bool haveOnceConnected();
|
|||
|
||||
virtual bool setMaxRates(const RsPgpId& pid,uint32_t maxR,uint32_t minR);
|
||||
virtual bool getMaxRates(const RsPgpId& pid,uint32_t& maxR,uint32_t& minR);
|
||||
virtual bool getMaxRates(const RsPeerId& pid,uint32_t& maxR,uint32_t& minR);
|
||||
|
||||
/************************************************************************************************/
|
||||
/* Extra IMPL Functions (used by p3LinkMgr, p3NetMgr + Setup) */
|
||||
|
|
|
@ -433,6 +433,7 @@ public:
|
|||
virtual void setServicePermissionFlags(const RsPgpId& gpg_id,const ServicePermissionFlags& flags) = 0;
|
||||
|
||||
virtual bool setPeerMaximumRates(const RsPgpId& pid,uint32_t maxUploadRate,uint32_t maxDownloadRate) =0;
|
||||
virtual bool getPeerMaximumRates(const RsPeerId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate) =0;
|
||||
virtual bool getPeerMaximumRates(const RsPgpId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate) =0;
|
||||
};
|
||||
|
||||
|
|
|
@ -241,6 +241,10 @@ bool p3Peers::isFriend(const RsPeerId &ssl_id)
|
|||
return mPeerMgr->isFriend(ssl_id);
|
||||
}
|
||||
|
||||
bool p3Peers::getPeerMaximumRates(const RsPeerId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate)
|
||||
{
|
||||
return mPeerMgr->getMaxRates(pid,maxUploadRate,maxDownloadRate) ;
|
||||
}
|
||||
bool p3Peers::getPeerMaximumRates(const RsPgpId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate)
|
||||
{
|
||||
return mPeerMgr->getMaxRates(pid,maxUploadRate,maxDownloadRate) ;
|
||||
|
|
|
@ -141,6 +141,7 @@ public:
|
|||
|
||||
virtual bool setPeerMaximumRates(const RsPgpId& pid,uint32_t maxUploadRate,uint32_t maxDownloadRate);
|
||||
virtual bool getPeerMaximumRates(const RsPgpId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate);
|
||||
virtual bool getPeerMaximumRates(const RsPeerId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate);
|
||||
private:
|
||||
|
||||
p3LinkMgr *mLinkMgr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue