mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-18 22:10:37 -04:00
* Moved DataRate interface from rsiface (old) -> rsConfig.
* Internally moved storage of data rate from pqipersongroup -> p3serverconfig * made DataRate + Operating Mode work together. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5889 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0fa8d55062
commit
de80f2aa3e
10 changed files with 113 additions and 130 deletions
|
@ -45,49 +45,6 @@ const int p3facemsgzone = 11453;
|
|||
/* RsIface Config */
|
||||
/* Config */
|
||||
|
||||
int RsServer::ConfigSetDataRates( int totalDownload, int totalUpload ) /* in kbrates */
|
||||
{
|
||||
/* fill the rsiface class */
|
||||
RsIface &iface = getIface();
|
||||
|
||||
/* lock Mutexes */
|
||||
lockRsCore(); /* LOCK */
|
||||
iface.lockData(); /* LOCK */
|
||||
|
||||
pqih -> setMaxRate(true, totalDownload);
|
||||
pqih -> setMaxRate(false, totalUpload);
|
||||
|
||||
pqih -> save_config();
|
||||
|
||||
/* unlock Mutexes */
|
||||
iface.unlockData(); /* UNLOCK */
|
||||
unlockRsCore(); /* UNLOCK */
|
||||
|
||||
/* does its own locking */
|
||||
UpdateAllConfig();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int RsServer::ConfigGetDataRates( float &inKb, float &outKb ) /* in kbrates */
|
||||
{
|
||||
/* fill the rsiface class */
|
||||
RsIface &iface = getIface();
|
||||
|
||||
/* lock Mutexes */
|
||||
lockRsCore(); /* LOCK */
|
||||
iface.lockData(); /* LOCK */
|
||||
|
||||
pqih -> getCurrentRates(inKb, outKb);
|
||||
|
||||
/* unlock Mutexes */
|
||||
iface.unlockData(); /* UNLOCK */
|
||||
unlockRsCore(); /* UNLOCK */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int RsServer::ConfigSetBootPrompt( bool /*on*/ )
|
||||
{
|
||||
|
||||
|
@ -120,11 +77,6 @@ int RsServer::UpdateAllConfig()
|
|||
|
||||
config.extAddr = rs_inet_ntoa(pstate.serveraddr.sin_addr);
|
||||
config.extPort = ntohs(pstate.serveraddr.sin_port);
|
||||
|
||||
/* data rates */
|
||||
config.maxDownloadDataRate = (int) pqih -> getMaxRate(true); /* kb */
|
||||
config.maxUploadDataRate = (int) pqih -> getMaxRate(false); /* kb */
|
||||
|
||||
config.promptAtBoot = true; /* popup the password prompt */
|
||||
|
||||
/* update network configuration */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue