mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 16:39:29 -05:00
Removed configuration type (uint32) as its not needed or really used.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7212 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
190988c3cc
commit
0e6302ac6a
@ -620,7 +620,7 @@ void CacheStore::locked_storeCacheEntry(const RsCacheData &data)
|
|||||||
********************************* CacheStrapper ********************************/
|
********************************* CacheStrapper ********************************/
|
||||||
|
|
||||||
CacheStrapper::CacheStrapper(p3ServiceControl *sc, uint32_t ftServiceId)
|
CacheStrapper::CacheStrapper(p3ServiceControl *sc, uint32_t ftServiceId)
|
||||||
:p3Config(CONFIG_TYPE_CACHE), mServiceCtrl(sc), mFtServiceId(ftServiceId),
|
:p3Config(), mServiceCtrl(sc), mFtServiceId(ftServiceId),
|
||||||
csMtx("CacheStrapper")
|
csMtx("CacheStrapper")
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -83,7 +83,7 @@ virtual int dhtInfoCallback(const bdId *id, uint32_t type, uint32_t flags, std::
|
|||||||
|
|
||||||
p3BitDht::p3BitDht(const RsPeerId& id, pqiConnectCb *cb, p3NetMgr *nm,
|
p3BitDht::p3BitDht(const RsPeerId& id, pqiConnectCb *cb, p3NetMgr *nm,
|
||||||
UdpStack *udpstack, std::string bootstrapfile)
|
UdpStack *udpstack, std::string bootstrapfile)
|
||||||
:p3Config(CONFIG_TYPE_BITDHT), pqiNetAssistConnect(id, cb), mNetMgr(nm), dhtMtx("p3BitDht")
|
:p3Config(), pqiNetAssistConnect(id, cb), mNetMgr(nm), dhtMtx("p3BitDht")
|
||||||
{
|
{
|
||||||
mDhtStunner = NULL;
|
mDhtStunner = NULL;
|
||||||
mProxyStunner = NULL;
|
mProxyStunner = NULL;
|
||||||
|
@ -99,7 +99,7 @@ ftFileControl::ftFileControl(std::string fname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ftController::ftController(CacheStrapper *cs, ftDataMultiplex *dm, p3ServiceControl *sc, uint32_t ftServiceId)
|
ftController::ftController(CacheStrapper *cs, ftDataMultiplex *dm, p3ServiceControl *sc, uint32_t ftServiceId)
|
||||||
:CacheTransfer(cs), p3Config(CONFIG_TYPE_FT_CONTROL),
|
:CacheTransfer(cs), p3Config(),
|
||||||
last_save_time(0),
|
last_save_time(0),
|
||||||
last_clean_time(0),
|
last_clean_time(0),
|
||||||
mDataplex(dm),
|
mDataplex(dm),
|
||||||
|
@ -123,7 +123,7 @@ bool ftFiStore::search(const RsFileHash &hash, FileSearchFlags hintflags, FileIn
|
|||||||
|
|
||||||
|
|
||||||
ftFiMonitor::ftFiMonitor(CacheStrapper *cs,std::string cachedir, const RsPeerId& pid,const std::string& config_dir)
|
ftFiMonitor::ftFiMonitor(CacheStrapper *cs,std::string cachedir, const RsPeerId& pid,const std::string& config_dir)
|
||||||
:FileIndexMonitor(cs,cachedir, pid,config_dir), p3Config(CONFIG_TYPE_FT_SHARED)
|
:FileIndexMonitor(cs,cachedir, pid,config_dir), p3Config()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
*****/
|
*****/
|
||||||
|
|
||||||
ftExtraList::ftExtraList()
|
ftExtraList::ftExtraList()
|
||||||
:p3Config(CONFIG_TYPE_FT_EXTRA_LIST), extMutex("p3Config")
|
:p3Config(), extMutex("p3Config")
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds,
|
|||||||
RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs,
|
RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs,
|
||||||
const RsServiceInfo serviceInfo,
|
const RsServiceInfo serviceInfo,
|
||||||
RsGixsReputation* reputations, RsGcxs* circles, bool grpAutoSync)
|
RsGixsReputation* reputations, RsGcxs* circles, bool grpAutoSync)
|
||||||
: p3ThreadedService(), p3Config(servType), mTransactionN(0),
|
: p3ThreadedService(), p3Config(), mTransactionN(0),
|
||||||
mObserver(nxsObs), mDataStore(gds), mServType(servType),
|
mObserver(nxsObs), mDataStore(gds), mServType(servType),
|
||||||
mTransactionTimeOut(TRANSAC_TIMEOUT), mNetMgr(netMgr), mNxsMutex("RsGxsNetService"),
|
mTransactionTimeOut(TRANSAC_TIMEOUT), mNetMgr(netMgr), mNxsMutex("RsGxsNetService"),
|
||||||
mSyncTs(0), mSYNC_PERIOD(SYNC_PERIOD), mCircles(circles), mReputations(reputations), mGrpAutoSync(grpAutoSync), mGrpServerUpdateItem(NULL),
|
mSyncTs(0), mSYNC_PERIOD(SYNC_PERIOD), mCircles(circles), mReputations(reputations), mGrpAutoSync(grpAutoSync), mGrpServerUpdateItem(NULL),
|
||||||
|
@ -41,7 +41,7 @@ typedef RsPlugin *(*RetroSharePluginEntry)(void) ;
|
|||||||
RsPluginHandler *rsPlugins ;
|
RsPluginHandler *rsPlugins ;
|
||||||
|
|
||||||
RsPluginManager::RsPluginManager(const RsFileHash &hash)
|
RsPluginManager::RsPluginManager(const RsFileHash &hash)
|
||||||
: p3Config(CONFIG_TYPE_PLUGINS),_current_executable_hash(hash)
|
: p3Config(),_current_executable_hash(hash)
|
||||||
{
|
{
|
||||||
_allow_all_plugins = false ;
|
_allow_all_plugins = false ;
|
||||||
}
|
}
|
||||||
@ -525,16 +525,16 @@ bool RsPluginManager::saveList(bool& cleanup, std::list<RsItem*>& list)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
RsCacheService::RsCacheService(uint16_t service_type,uint32_t config_type,uint32_t tick_delay, RsPluginHandler* pgHandler)
|
RsCacheService::RsCacheService(uint16_t service_type,uint32_t tick_delay, RsPluginHandler* pgHandler)
|
||||||
: CacheSource(service_type, true, pgHandler->getFileServer()->getCacheStrapper(), pgHandler->getLocalCacheDir()),
|
: CacheSource(service_type, true, pgHandler->getFileServer()->getCacheStrapper(), pgHandler->getLocalCacheDir()),
|
||||||
CacheStore (service_type, true, pgHandler->getFileServer()->getCacheStrapper(), pgHandler->getFileServer()->getCacheTransfer(), pgHandler->getRemoteCacheDir()),
|
CacheStore (service_type, true, pgHandler->getFileServer()->getCacheStrapper(), pgHandler->getFileServer()->getCacheTransfer(), pgHandler->getRemoteCacheDir()),
|
||||||
p3Config(config_type), // CONFIG_TYPE_RANK_LINK
|
p3Config(),
|
||||||
_tick_delay_in_seconds(tick_delay)
|
_tick_delay_in_seconds(tick_delay)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RsPQIService::RsPQIService(uint16_t service_type,uint32_t config_type,uint32_t /*tick_delay_in_seconds*/, RsPluginHandler* /*pgHandler*/)
|
RsPQIService::RsPQIService(uint16_t service_type,uint32_t /*tick_delay_in_seconds*/, RsPluginHandler* /*pgHandler*/)
|
||||||
: p3Service(),p3Config(config_type)
|
: p3Service(),p3Config()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
class RsCacheService: public CacheSource, public CacheStore, public p3Config
|
class RsCacheService: public CacheSource, public CacheStore, public p3Config
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsCacheService(uint16_t type,uint32_t config_type,uint32_t tick_delay_in_seconds, RsPluginHandler* pgHandler) ;
|
RsCacheService(uint16_t type,uint32_t tick_delay_in_seconds, RsPluginHandler* pgHandler) ;
|
||||||
|
|
||||||
uint32_t tickDelay() const { return _tick_delay_in_seconds ; }
|
uint32_t tickDelay() const { return _tick_delay_in_seconds ; }
|
||||||
virtual void tick() {}
|
virtual void tick() {}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
class RsPQIService: public p3Service, public p3Config
|
class RsPQIService: public p3Service, public p3Config
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsPQIService(uint16_t type,uint32_t config_type,uint32_t tick_delay_in_seconds, RsPluginHandler* pgHandler) ;
|
RsPQIService(uint16_t type,uint32_t tick_delay_in_seconds, RsPluginHandler* pgHandler) ;
|
||||||
|
|
||||||
uint32_t tickDelay() const { return _tick_delay_in_seconds ; }
|
uint32_t tickDelay() const { return _tick_delay_in_seconds ; }
|
||||||
virtual int tick() = 0 ;
|
virtual int tick() = 0 ;
|
||||||
|
@ -121,12 +121,12 @@ void AuthGPG::exit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
AuthGPG::AuthGPG(const std::string& path_to_public_keyring,const std::string& path_to_secret_keyring,const std::string& path_to_trustdb,const std::string& pgp_lock_file)
|
AuthGPG::AuthGPG(const std::string& path_to_public_keyring,const std::string& path_to_secret_keyring,const std::string& path_to_trustdb,const std::string& pgp_lock_file)
|
||||||
:p3Config(CONFIG_TYPE_AUTHGPG),
|
:p3Config(),
|
||||||
PGPHandler(path_to_public_keyring,path_to_secret_keyring,path_to_trustdb,pgp_lock_file),
|
PGPHandler(path_to_public_keyring,path_to_secret_keyring,path_to_trustdb,pgp_lock_file),
|
||||||
gpgMtxService("AuthGPG-service"),
|
gpgMtxService("AuthGPG-service"),
|
||||||
gpgMtxEngine("AuthGPG-engine"),
|
gpgMtxEngine("AuthGPG-engine"),
|
||||||
gpgMtxData("AuthGPG-data"),
|
gpgMtxData("AuthGPG-data"),
|
||||||
gpgKeySelected(false)
|
gpgKeySelected(false)
|
||||||
{
|
{
|
||||||
_force_sync_database = false ;
|
_force_sync_database = false ;
|
||||||
start();
|
start();
|
||||||
|
@ -276,7 +276,7 @@ sslcert::sslcert(X509 *x509, const RsPeerId& pid)
|
|||||||
|
|
||||||
|
|
||||||
AuthSSLimpl::AuthSSLimpl()
|
AuthSSLimpl::AuthSSLimpl()
|
||||||
: p3Config(CONFIG_TYPE_AUTHSSL), sslctx(NULL),
|
: p3Config(), sslctx(NULL),
|
||||||
mOwnCert(NULL), sslMtx("AuthSSL"), mOwnPrivateKey(NULL), mOwnPublicKey(NULL), init(0)
|
mOwnCert(NULL), sslMtx("AuthSSL"), mOwnPrivateKey(NULL), mOwnPublicKey(NULL), init(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -57,10 +57,10 @@ void p3ConfigMgr::tick()
|
|||||||
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
||||||
|
|
||||||
/* iterate through and check if any have changed */
|
/* iterate through and check if any have changed */
|
||||||
std::map<uint32_t, pqiConfig *>::iterator it;
|
std::list<pqiConfig *>::iterator it;
|
||||||
for(it = configs.begin(); it != configs.end(); it++)
|
for(it = mConfigs.begin(); it != mConfigs.end(); it++)
|
||||||
{
|
{
|
||||||
if (it->second->HasConfigChanged(0))
|
if ((*it)->HasConfigChanged(0))
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
@ -104,17 +104,17 @@ void p3ConfigMgr::saveConfig()
|
|||||||
|
|
||||||
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
||||||
|
|
||||||
std::map<uint32_t, pqiConfig *>::iterator it;
|
std::list<pqiConfig *>::iterator it;
|
||||||
for(it = configs.begin(); it != configs.end(); it++)
|
for(it = mConfigs.begin(); it != mConfigs.end(); it++)
|
||||||
{
|
{
|
||||||
if (it->second->HasConfigChanged(1))
|
if ((*it)->HasConfigChanged(1))
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
std::cerr << "p3ConfigMgr::globalSaveConfig() Saving Element: ";
|
std::cerr << "p3ConfigMgr::globalSaveConfig() Saving Element: ";
|
||||||
std::cerr << it->first;
|
std::cerr << it->first;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
ok &= it->second->saveConfiguration();
|
ok &= (*it)->saveConfiguration();
|
||||||
}
|
}
|
||||||
/* save metaconfig */
|
/* save metaconfig */
|
||||||
}
|
}
|
||||||
@ -131,9 +131,9 @@ void p3ConfigMgr::loadConfiguration()
|
|||||||
|
|
||||||
void p3ConfigMgr::loadConfig()
|
void p3ConfigMgr::loadConfig()
|
||||||
{
|
{
|
||||||
std::map<uint32_t, pqiConfig *>::iterator cit;
|
std::list<pqiConfig *>::iterator cit;
|
||||||
RsFileHash dummyHash ;
|
RsFileHash dummyHash ;
|
||||||
for (cit = configs.begin(); cit != configs.end(); cit++)
|
for (cit = mConfigs.begin(); cit != mConfigs.end(); cit++)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
std::cerr << "p3ConfigMgr::loadConfig() Element: ";
|
std::cerr << "p3ConfigMgr::loadConfig() Element: ";
|
||||||
@ -141,11 +141,11 @@ void p3ConfigMgr::loadConfig()
|
|||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cit->second->loadConfiguration(dummyHash);
|
(*cit)->loadConfiguration(dummyHash);
|
||||||
|
|
||||||
/* force config to NOT CHANGED */
|
/* force config to NOT CHANGED */
|
||||||
cit->second->HasConfigChanged(0);
|
(*cit)->HasConfigChanged(0);
|
||||||
cit->second->HasConfigChanged(1);
|
(*cit)->HasConfigChanged(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -165,16 +165,20 @@ void p3ConfigMgr::addConfiguration(std::string file, pqiConfig *conf)
|
|||||||
filename += "config/";
|
filename += "config/";
|
||||||
filename += file;
|
filename += file;
|
||||||
|
|
||||||
conf->setFilename(filename);
|
std::list<pqiConfig *>::iterator cit = std::find(mConfigs.begin(),mConfigs.end(),conf);
|
||||||
|
if (cit != mConfigs.end())
|
||||||
std::map<uint32_t, pqiConfig *>::iterator cit = configs.find(conf->Type());
|
|
||||||
if (cit != configs.end())
|
|
||||||
{
|
{
|
||||||
std::cerr << "p3Config::addConfiguration() WARNING: type " << conf->Type();
|
std::cerr << "p3Config::addConfiguration() Config already added";
|
||||||
std::cerr << " with filename " << filename;
|
std::cerr << std::endl;
|
||||||
std::cerr << " already added with filename " << cit->second->Filename() << std::endl;
|
std::cerr << "\tOriginal filename " << (*cit)->Filename();
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "\tIgnoring new filename " << filename;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
configs[conf->Type()] = conf;
|
|
||||||
|
conf->setFilename(filename);
|
||||||
|
mConfigs.push_back(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -188,8 +192,8 @@ void p3ConfigMgr::completeConfiguration()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
p3Config::p3Config(uint32_t t)
|
p3Config::p3Config()
|
||||||
:pqiConfig(t)
|
:pqiConfig()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -407,7 +411,7 @@ bool p3Config::saveConfig()
|
|||||||
/**************************** CONFIGURATION CLASSES ********************/
|
/**************************** CONFIGURATION CLASSES ********************/
|
||||||
|
|
||||||
p3GeneralConfig::p3GeneralConfig()
|
p3GeneralConfig::p3GeneralConfig()
|
||||||
:p3Config(CONFIG_TYPE_GENERAL)
|
:p3Config()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -544,8 +548,8 @@ bool p3GeneralConfig::loadList(std::list<RsItem *>& load)
|
|||||||
* only the Indication and hash really need it
|
* only the Indication and hash really need it
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pqiConfig::pqiConfig(uint32_t t)
|
pqiConfig::pqiConfig()
|
||||||
: cfgMtx("pqiConfig"), ConfInd(2), type(t)
|
: cfgMtx("pqiConfig"), ConfInd(2)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -555,12 +559,6 @@ pqiConfig::~pqiConfig()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t pqiConfig::Type()
|
|
||||||
{
|
|
||||||
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& pqiConfig::Filename()
|
const std::string& pqiConfig::Filename()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
#include "pqi/pqi_base.h"
|
#include "pqi/pqi_base.h"
|
||||||
#include "pqi/pqiindic.h"
|
#include "pqi/pqiindic.h"
|
||||||
@ -59,48 +60,9 @@
|
|||||||
*
|
*
|
||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
const uint32_t CONFIG_TYPE_GENERAL = 0x0001;
|
|
||||||
const uint32_t CONFIG_TYPE_PEERS = 0x0002;
|
|
||||||
const uint32_t CONFIG_TYPE_FSERVER = 0x0003;
|
|
||||||
const uint32_t CONFIG_TYPE_MSGS = 0x0004;
|
|
||||||
const uint32_t CONFIG_TYPE_AUTHGPG = 0x0006;
|
|
||||||
|
|
||||||
/* new FileTransfer */
|
|
||||||
const uint32_t CONFIG_TYPE_FT_SHARED = 0x0007;
|
|
||||||
const uint32_t CONFIG_TYPE_FT_EXTRA_LIST= 0x0008;
|
|
||||||
const uint32_t CONFIG_TYPE_FT_CONTROL = 0x0009;
|
|
||||||
const uint32_t CONFIG_TYPE_FT_DWLQUEUE = 0x000A;
|
|
||||||
|
|
||||||
const uint32_t CONFIG_TYPE_P3DISC = 0x000B;
|
|
||||||
const uint32_t CONFIG_TYPE_AUTHSSL = 0x000C;
|
|
||||||
|
|
||||||
/* wish these ids where higher...
|
|
||||||
* may move when switch to v0.5
|
|
||||||
*/
|
|
||||||
const uint32_t CONFIG_TYPE_CHAT = 0x0012;
|
|
||||||
const uint32_t CONFIG_TYPE_STATUS = 0x0013;
|
|
||||||
const uint32_t CONFIG_TYPE_PLUGINS = 0x0014;
|
|
||||||
const uint32_t CONFIG_TYPE_HISTORY = 0x0015;
|
|
||||||
|
|
||||||
/// turtle router
|
|
||||||
const uint32_t CONFIG_TYPE_TURTLE = 0x0020;
|
|
||||||
|
|
||||||
/// dht (relay stuff mainly)
|
|
||||||
const uint32_t CONFIG_TYPE_BITDHT = 0x0030;
|
|
||||||
|
|
||||||
/* standard services */
|
|
||||||
const uint32_t CONFIG_TYPE_QBLOG = 0x0101;
|
|
||||||
const uint32_t CONFIG_TYPE_FORUMS = 0x0102;
|
|
||||||
const uint32_t CONFIG_TYPE_CHANNELS = 0x0103;
|
|
||||||
|
|
||||||
const uint32_t CONFIG_TYPE_GXS_REPUTATION = 0x0200;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* CACHE ID Must be at the END so that other configurations
|
/* CACHE ID Must be at the END so that other configurations
|
||||||
* are loaded First (Cache Config --> Cache Loading)
|
* are loaded First (Cache Config --> Cache Loading)
|
||||||
*/
|
*/
|
||||||
const uint32_t CONFIG_TYPE_CACHE = 0xff01;
|
|
||||||
|
|
||||||
class p3ConfigMgr;
|
class p3ConfigMgr;
|
||||||
|
|
||||||
@ -114,7 +76,7 @@ class p3ConfigMgr;
|
|||||||
class pqiConfig
|
class pqiConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
pqiConfig(uint32_t t);
|
pqiConfig();
|
||||||
virtual ~pqiConfig();
|
virtual ~pqiConfig();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,12 +91,6 @@ virtual bool loadConfiguration(RsFileHash &loadHash) = 0;
|
|||||||
*/
|
*/
|
||||||
virtual bool saveConfiguration() = 0;
|
virtual bool saveConfiguration() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of configuration, see ids where this class is declared
|
|
||||||
* @see p3cfgmgr.h
|
|
||||||
*/
|
|
||||||
uint32_t Type();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the configuration file
|
* The name of the configuration file
|
||||||
*/
|
*/
|
||||||
@ -170,17 +126,13 @@ void setHash(const RsFileHash& h);
|
|||||||
|
|
||||||
Indicator ConfInd;
|
Indicator ConfInd;
|
||||||
|
|
||||||
uint32_t type;
|
|
||||||
std::string filename;
|
std::string filename;
|
||||||
RsFileHash hash;
|
RsFileHash hash;
|
||||||
|
|
||||||
|
|
||||||
friend class p3ConfigMgr;
|
friend class p3ConfigMgr;
|
||||||
/* so it can access:
|
/* so it can access:
|
||||||
* setFilename() and HasConfigChanged()
|
* setFilename() and HasConfigChanged()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -244,12 +196,12 @@ class p3ConfigMgr
|
|||||||
*/
|
*/
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
|
|
||||||
const std::string basedir;
|
const std::string basedir;
|
||||||
|
|
||||||
RsMutex cfgMtx; /* below is protected */
|
RsMutex cfgMtx; /* below is protected */
|
||||||
|
|
||||||
bool mConfigSaveActive;
|
bool mConfigSaveActive;
|
||||||
std::map<uint32_t, pqiConfig *> configs;
|
std::list<pqiConfig *> mConfigs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -266,7 +218,7 @@ class p3Config: public pqiConfig
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
p3Config(uint32_t t);
|
p3Config();
|
||||||
|
|
||||||
virtual bool loadConfiguration(RsFileHash &loadHash);
|
virtual bool loadConfiguration(RsFileHash &loadHash);
|
||||||
virtual bool saveConfiguration();
|
virtual bool saveConfiguration();
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
RsHistory *rsHistory = NULL;
|
RsHistory *rsHistory = NULL;
|
||||||
|
|
||||||
p3HistoryMgr::p3HistoryMgr()
|
p3HistoryMgr::p3HistoryMgr()
|
||||||
: p3Config(CONFIG_TYPE_HISTORY), mHistoryMtx("p3HistoryMgr")
|
: p3Config(), mHistoryMtx("p3HistoryMgr")
|
||||||
{
|
{
|
||||||
nextMsgId = 1;
|
nextMsgId = 1;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ std::string textPeerConnectState(peerState &state)
|
|||||||
|
|
||||||
|
|
||||||
p3PeerMgrIMPL::p3PeerMgrIMPL(const RsPeerId& ssl_own_id, const RsPgpId& gpg_own_id, const std::string& gpg_own_name, const std::string& ssl_own_location)
|
p3PeerMgrIMPL::p3PeerMgrIMPL(const RsPeerId& ssl_own_id, const RsPgpId& gpg_own_id, const std::string& gpg_own_name, const std::string& ssl_own_location)
|
||||||
:p3Config(CONFIG_TYPE_PEERS), mPeerMtx("p3PeerMgr"), mStatusChanged(false)
|
:p3Config(), mPeerMtx("p3PeerMgr"), mStatusChanged(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1630,7 +1630,6 @@ int RsServer::StartupRetroShare()
|
|||||||
|
|
||||||
mConfigMgr->addConfiguration("peers.cfg", mPeerMgr);
|
mConfigMgr->addConfiguration("peers.cfg", mPeerMgr);
|
||||||
mConfigMgr->addConfiguration("general.cfg", mGeneralConfig);
|
mConfigMgr->addConfiguration("general.cfg", mGeneralConfig);
|
||||||
mConfigMgr->addConfiguration("cache.cfg", mCacheStrapper);
|
|
||||||
mConfigMgr->addConfiguration("msgs.cfg", msgSrv);
|
mConfigMgr->addConfiguration("msgs.cfg", msgSrv);
|
||||||
mConfigMgr->addConfiguration("chat.cfg", chatSrv);
|
mConfigMgr->addConfiguration("chat.cfg", chatSrv);
|
||||||
mConfigMgr->addConfiguration("p3History.cfg", mHistoryMgr);
|
mConfigMgr->addConfiguration("p3History.cfg", mHistoryMgr);
|
||||||
@ -1645,7 +1644,6 @@ int RsServer::StartupRetroShare()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RS_ENABLE_GXS
|
#ifdef RS_ENABLE_GXS
|
||||||
|
|
||||||
mConfigMgr->addConfiguration("identity.cfg", gxsid_ns);
|
mConfigMgr->addConfiguration("identity.cfg", gxsid_ns);
|
||||||
mConfigMgr->addConfiguration("gxsforums.cfg", gxsforums_ns);
|
mConfigMgr->addConfiguration("gxsforums.cfg", gxsforums_ns);
|
||||||
mConfigMgr->addConfiguration("gxschannels.cfg", gxschannels_ns);
|
mConfigMgr->addConfiguration("gxschannels.cfg", gxschannels_ns);
|
||||||
@ -1654,7 +1652,6 @@ int RsServer::StartupRetroShare()
|
|||||||
mConfigMgr->addConfiguration("wire.cfg", wire_ns);
|
mConfigMgr->addConfiguration("wire.cfg", wire_ns);
|
||||||
mConfigMgr->addConfiguration("wiki.cfg", wiki_ns);
|
mConfigMgr->addConfiguration("wiki.cfg", wiki_ns);
|
||||||
mConfigMgr->addConfiguration("photo.cfg", photo_ns);
|
mConfigMgr->addConfiguration("photo.cfg", photo_ns);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mPluginsManager->addConfigurations(mConfigMgr) ;
|
mPluginsManager->addConfigurations(mConfigMgr) ;
|
||||||
@ -1666,13 +1663,14 @@ int RsServer::StartupRetroShare()
|
|||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
std::cerr << "(2) Load configuration files" << std::endl;
|
std::cerr << "(2) Load configuration files" << std::endl;
|
||||||
|
|
||||||
mConfigMgr->loadConfiguration();
|
|
||||||
|
|
||||||
/* NOTE: CacheStrapper's load causes Cache Files to be
|
/* NOTE: CacheStrapper's load causes Cache Files to be
|
||||||
* loaded into all the CacheStores/Sources. This happens
|
* loaded into all the CacheStores/Sources. This happens
|
||||||
* after all the other configurations have happened.
|
* after all the other configurations have happened.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
mConfigMgr->addConfiguration("cache.cfg", mCacheStrapper);
|
||||||
|
mConfigMgr->loadConfiguration();
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/* trigger generalConfig loading for classes that require it */
|
/* trigger generalConfig loading for classes that require it */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -76,7 +76,7 @@ static const uint32_t MAX_MESSAGES_PER_SECONDS_NUMBER = 5 ; // max number o
|
|||||||
static const uint32_t MAX_MESSAGES_PER_SECONDS_PERIOD = 10 ; // duration window for max number of messages before messages get dropped.
|
static const uint32_t MAX_MESSAGES_PER_SECONDS_PERIOD = 10 ; // duration window for max number of messages before messages get dropped.
|
||||||
|
|
||||||
p3ChatService::p3ChatService(p3ServiceControl *sc, p3LinkMgr *lm, p3HistoryMgr *historyMgr)
|
p3ChatService::p3ChatService(p3ServiceControl *sc, p3LinkMgr *lm, p3HistoryMgr *historyMgr)
|
||||||
:p3Service(), p3Config(CONFIG_TYPE_CHAT), mChatMtx("p3ChatService"), mServiceCtrl(sc), mLinkMgr(lm) , mHistoryMgr(historyMgr)
|
:p3Service(), p3Config(), mChatMtx("p3ChatService"), mServiceCtrl(sc), mLinkMgr(lm) , mHistoryMgr(historyMgr)
|
||||||
{
|
{
|
||||||
_serializer = new RsChatSerialiser() ;
|
_serializer = new RsChatSerialiser() ;
|
||||||
_own_avatar = NULL ;
|
_own_avatar = NULL ;
|
||||||
|
@ -123,7 +123,7 @@ uint32_t ConvertToSerialised(int32_t value, bool limit)
|
|||||||
|
|
||||||
|
|
||||||
p3GxsReputation::p3GxsReputation(p3LinkMgr *lm)
|
p3GxsReputation::p3GxsReputation(p3LinkMgr *lm)
|
||||||
:p3Service(), p3Config(CONFIG_TYPE_GXS_REPUTATION),
|
:p3Service(), p3Config(),
|
||||||
mReputationMtx("p3GxsReputation"), mLinkMgr(lm)
|
mReputationMtx("p3GxsReputation"), mLinkMgr(lm)
|
||||||
{
|
{
|
||||||
addSerialType(new RsGxsReputationSerialiser());
|
addSerialType(new RsGxsReputationSerialiser());
|
||||||
|
@ -76,7 +76,7 @@ static const uint8_t ENCRYPTED_MSG_PROTOCOL_VERSION_01 = 0x37 ;
|
|||||||
|
|
||||||
|
|
||||||
p3MsgService::p3MsgService(p3ServiceControl *sc)
|
p3MsgService::p3MsgService(p3ServiceControl *sc)
|
||||||
:p3Service(), p3Config(CONFIG_TYPE_MSGS),
|
:p3Service(), p3Config(),
|
||||||
mServiceCtrl(sc), mMsgMtx("p3MsgService"), mMsgUniqueId(time(NULL))
|
mServiceCtrl(sc), mMsgMtx("p3MsgService"), mMsgUniqueId(time(NULL))
|
||||||
{
|
{
|
||||||
_serialiser = new RsMsgSerialiser();
|
_serialiser = new RsMsgSerialiser();
|
||||||
|
@ -48,7 +48,7 @@ std::ostream& operator<<(std::ostream& out, const StatusInfo& si)
|
|||||||
RsStatus *rsStatus = NULL;
|
RsStatus *rsStatus = NULL;
|
||||||
|
|
||||||
p3StatusService::p3StatusService(p3ServiceControl *sc)
|
p3StatusService::p3StatusService(p3ServiceControl *sc)
|
||||||
:p3Service(), p3Config(CONFIG_TYPE_STATUS), mServiceCtrl(sc), mStatusMtx("p3StatusService")
|
:p3Service(), p3Config(), mServiceCtrl(sc), mStatusMtx("p3StatusService")
|
||||||
{
|
{
|
||||||
addSerialType(new RsStatusSerialiser());
|
addSerialType(new RsStatusSerialiser());
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ static const int MAX_TR_FORWARD_PER_SEC_LOWER_LIMIT = 10 ;
|
|||||||
static const int DISTANCE_SQUEEZING_POWER = 8 ;
|
static const int DISTANCE_SQUEEZING_POWER = 8 ;
|
||||||
|
|
||||||
p3turtle::p3turtle(p3LinkMgr *lm)
|
p3turtle::p3turtle(p3LinkMgr *lm)
|
||||||
:p3Service(), p3Config(CONFIG_TYPE_TURTLE), mLinkMgr(lm), mTurtleMtx("p3turtle")
|
:p3Service(), p3Config(), mLinkMgr(lm), mTurtleMtx("p3turtle")
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/
|
RsStackMutex stack(mTurtleMtx); /********** STACK LOCKED MTX ******/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user