Reverted some of my last changes:

- removing the core lock in RsServer::ConfigGetDataRates
- changes in p3ConfigMgr::loadConfig

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4726 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-12-12 16:07:38 +00:00
parent e150e31401
commit f3a0924461
3 changed files with 15 additions and 30 deletions

View File

@ -362,35 +362,19 @@ void p3ConfigMgr::loadConfig()
{ {
std::map<uint32_t, pqiConfig *>::iterator cit; std::map<uint32_t, pqiConfig *>::iterator cit;
std::string dummyHash = "dummyHash"; std::string dummyHash = "dummyHash";
for (cit = configs.begin(); cit != configs.end(); cit++)
// step 0 -> load CONFIG_TYPE_AUTHGPG {
// step 1 -> load all other
for (int step = 0; step < 2; ++step) {
for (cit = configs.begin(); cit != configs.end(); cit++)
{
if ((step == 0 && cit->first != CONFIG_TYPE_AUTHGPG) ||
(step == 1 && cit->first == CONFIG_TYPE_AUTHGPG)) {
// don't load configuration
continue;
}
#ifdef CONFIG_DEBUG #ifdef CONFIG_DEBUG
std::cerr << "p3ConfigMgr::loadConfig() Element: "; std::cerr << "p3ConfigMgr::loadConfig() Element: ";
std::cerr << cit->first <<"Dummy Hash: " << dummyHash; std::cerr << cit->first <<"Dummy Hash: " << dummyHash;
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
cit->second->loadConfiguration(dummyHash); cit->second->loadConfiguration(dummyHash);
/* force config to NOT CHANGED */ /* force config to NOT CHANGED */
cit->second->HasConfigChanged(0); cit->second->HasConfigChanged(0);
cit->second->HasConfigChanged(1); cit->second->HasConfigChanged(1);
if (step == 0) {
// CONFIG_TYPE_AUTHGPG loaded
break;
}
}
} }
return; return;

View File

@ -73,17 +73,17 @@ int RsServer::ConfigSetDataRates( int totalDownload, int totalUpload ) /* in
int RsServer::ConfigGetDataRates( float &inKb, float &outKb ) /* in kbrates */ int RsServer::ConfigGetDataRates( float &inKb, float &outKb ) /* in kbrates */
{ {
/* fill the rsiface class */ /* fill the rsiface class */
// RsIface &iface = getIface(); RsIface &iface = getIface();
/* lock Mutexes */ /* lock Mutexes */
// lockRsCore(); /* LOCK */ lockRsCore(); /* LOCK */
// iface.lockData(); /* LOCK */ iface.lockData(); /* LOCK */
pqih -> getCurrentRates(inKb, outKb); pqih -> getCurrentRates(inKb, outKb);
/* unlock Mutexes */ /* unlock Mutexes */
// iface.unlockData(); /* UNLOCK */ iface.unlockData(); /* UNLOCK */
// unlockRsCore(); /* UNLOCK */ unlockRsCore(); /* UNLOCK */
return 1; return 1;
} }

View File

@ -2181,6 +2181,7 @@ int RsServer::StartupRetroShare()
//mConfigMgr->addConfiguration("ftserver.cfg", ftserver); //mConfigMgr->addConfiguration("ftserver.cfg", ftserver);
// //
mConfigMgr->addConfiguration("gpg_prefs.cfg", (AuthGPGimpl *) AuthGPG::getAuthGPG()); mConfigMgr->addConfiguration("gpg_prefs.cfg", (AuthGPGimpl *) AuthGPG::getAuthGPG());
mConfigMgr->loadConfiguration();
mConfigMgr->addConfiguration("peers.cfg", mPeerMgr); mConfigMgr->addConfiguration("peers.cfg", mPeerMgr);
mConfigMgr->addConfiguration("general.cfg", mGeneralConfig); mConfigMgr->addConfiguration("general.cfg", mGeneralConfig);