mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 15:35:49 -04:00
added proper talking between pqihandler and GUI for maxrates fixing
This commit is contained in:
parent
509266a25b
commit
5a0fa66ac0
10 changed files with 97 additions and 37 deletions
|
@ -241,6 +241,11 @@ 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::setPeerMaximumRates(const RsPeerId& pid,uint32_t maxUploadRate,uint32_t maxDownloadRate)
|
||||
{
|
||||
return mPeerMgr->setMaxRates(pid,maxUploadRate,maxDownloadRate) ;
|
||||
|
|
|
@ -140,6 +140,7 @@ public:
|
|||
virtual void setServicePermissionFlags(const RsPgpId& gpg_id,const ServicePermissionFlags& flags);
|
||||
|
||||
virtual bool setPeerMaximumRates(const RsPeerId& pid,uint32_t maxUploadRate,uint32_t maxDownloadRate);
|
||||
virtual bool getPeerMaximumRates(const RsPeerId& pid,uint32_t& maxUploadRate,uint32_t& maxDownloadRate);
|
||||
private:
|
||||
|
||||
p3LinkMgr *mLinkMgr;
|
||||
|
|
|
@ -503,6 +503,13 @@ bool p3ServerConfig::switchToOperatingMode(uint32_t opMode)
|
|||
return true;
|
||||
}
|
||||
|
||||
int p3ServerConfig::SetMaxDataRates(const RsPeerId& pid, int downKb, int upKb ) /* in kbrates */
|
||||
{
|
||||
mPqiHandler->setMaxRate(pid,true,downKb) ;
|
||||
mPqiHandler->setMaxRate(pid,false,upKb) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
/* handle data rates.
|
||||
* Mutex must be handled at the lower levels: TODO */
|
||||
|
|
|
@ -95,6 +95,7 @@ virtual bool setOperatingMode(uint32_t opMode);
|
|||
virtual int SetMaxDataRates( int downKb, int upKb );
|
||||
virtual int GetMaxDataRates( int &downKb, int &upKb );
|
||||
virtual int GetCurrentDataRates( float &inKb, float &outKb );
|
||||
virtual int SetMaxDataRates(const RsPeerId& pid, int downKb, int upKb );
|
||||
|
||||
/********************* ABOVE is RsConfig Interface *******/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue