From f3a092446198f79f854fa1fe100b82c07661a0b9 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 12 Dec 2011 16:07:38 +0000 Subject: [PATCH] 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 --- libretroshare/src/pqi/p3cfgmgr.cc | 34 ++++++--------------- libretroshare/src/rsserver/p3face-config.cc | 10 +++--- libretroshare/src/rsserver/rsinit.cc | 1 + 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index 3c7f0b741..36f33288b 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -362,35 +362,19 @@ void p3ConfigMgr::loadConfig() { std::map::iterator cit; std::string dummyHash = "dummyHash"; - - // 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; - } - + for (cit = configs.begin(); cit != configs.end(); cit++) + { #ifdef CONFIG_DEBUG - std::cerr << "p3ConfigMgr::loadConfig() Element: "; - std::cerr << cit->first <<"Dummy Hash: " << dummyHash; - std::cerr << std::endl; + std::cerr << "p3ConfigMgr::loadConfig() Element: "; + std::cerr << cit->first <<"Dummy Hash: " << dummyHash; + std::cerr << std::endl; #endif - cit->second->loadConfiguration(dummyHash); + cit->second->loadConfiguration(dummyHash); - /* force config to NOT CHANGED */ - cit->second->HasConfigChanged(0); - cit->second->HasConfigChanged(1); - - if (step == 0) { - // CONFIG_TYPE_AUTHGPG loaded - break; - } - } + /* force config to NOT CHANGED */ + cit->second->HasConfigChanged(0); + cit->second->HasConfigChanged(1); } return; diff --git a/libretroshare/src/rsserver/p3face-config.cc b/libretroshare/src/rsserver/p3face-config.cc index 80c6affe4..37e812250 100644 --- a/libretroshare/src/rsserver/p3face-config.cc +++ b/libretroshare/src/rsserver/p3face-config.cc @@ -73,17 +73,17 @@ int RsServer::ConfigSetDataRates( int totalDownload, int totalUpload ) /* in int RsServer::ConfigGetDataRates( float &inKb, float &outKb ) /* in kbrates */ { /* fill the rsiface class */ -// RsIface &iface = getIface(); + RsIface &iface = getIface(); /* lock Mutexes */ -// lockRsCore(); /* LOCK */ -// iface.lockData(); /* LOCK */ + lockRsCore(); /* LOCK */ + iface.lockData(); /* LOCK */ pqih -> getCurrentRates(inKb, outKb); /* unlock Mutexes */ -// iface.unlockData(); /* UNLOCK */ -// unlockRsCore(); /* UNLOCK */ + iface.unlockData(); /* UNLOCK */ + unlockRsCore(); /* UNLOCK */ return 1; } diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index e1dd37545..fb6be7c7b 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -2181,6 +2181,7 @@ int RsServer::StartupRetroShare() //mConfigMgr->addConfiguration("ftserver.cfg", ftserver); // mConfigMgr->addConfiguration("gpg_prefs.cfg", (AuthGPGimpl *) AuthGPG::getAuthGPG()); + mConfigMgr->loadConfiguration(); mConfigMgr->addConfiguration("peers.cfg", mPeerMgr); mConfigMgr->addConfiguration("general.cfg", mGeneralConfig);