mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
removed channel delete feature
added optimisation suggestion with load/savelist git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3920 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d3a6f7316c
commit
2f559dae96
37 changed files with 133 additions and 388 deletions
|
@ -2310,7 +2310,7 @@ RsSerialiser *AuthGPGimpl::setupSerialiser()
|
|||
return rss ;
|
||||
}
|
||||
|
||||
std::list<RsItem*> AuthGPGimpl::saveList(bool& cleanup)
|
||||
bool AuthGPGimpl::saveList(bool& cleanup, std::list<RsItem*>& lst)
|
||||
{
|
||||
#ifdef GPG_DEBUG
|
||||
std::cerr << "AuthGPGimpl::saveList() called" << std::endl ;
|
||||
|
@ -2319,8 +2319,6 @@ std::list<RsItem*> AuthGPGimpl::saveList(bool& cleanup)
|
|||
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
|
||||
|
||||
cleanup = true ;
|
||||
std::list<RsItem*> lst ;
|
||||
|
||||
|
||||
// Now save config for network digging strategies
|
||||
RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ;
|
||||
|
@ -2339,10 +2337,10 @@ std::list<RsItem*> AuthGPGimpl::saveList(bool& cleanup)
|
|||
}
|
||||
lst.push_back(vitem);
|
||||
|
||||
return lst ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
bool AuthGPGimpl::loadList(std::list<RsItem*> load)
|
||||
bool AuthGPGimpl::loadList(std::list<RsItem*>& load)
|
||||
{
|
||||
#ifdef GPG_DEBUG
|
||||
std::cerr << "AuthGPGimpl::loadList() Item Count: " << load.size() << std::endl;
|
||||
|
|
|
@ -380,8 +380,8 @@ virtual bool addService(AuthGPGService *service);
|
|||
/*********************** p3config ******************************/
|
||||
/* Key Functions to be overloaded for Full Configuration */
|
||||
virtual RsSerialiser *setupSerialiser();
|
||||
virtual std::list<RsItem *> saveList(bool &cleanup);
|
||||
virtual bool loadList(std::list<RsItem *> load);
|
||||
virtual bool saveList(bool &cleanup, std::list<RsItem *>&);
|
||||
virtual bool loadList(std::list<RsItem *>& load);
|
||||
/*****************************************************************/
|
||||
|
||||
private:
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
* #define AUTHSSL_DEBUG 1
|
||||
***/
|
||||
|
||||
// initialisation du pointeur de singleton à zéro
|
||||
// initialisation du pointeur de singleton <EFBFBD> z<>ro
|
||||
static AuthSSL *instance_ssl = NULL;
|
||||
|
||||
/* hidden function - for testing purposes() */
|
||||
|
@ -1256,7 +1256,7 @@ RsSerialiser *AuthSSLimpl::setupSerialiser()
|
|||
return rss ;
|
||||
}
|
||||
|
||||
std::list<RsItem*> AuthSSLimpl::saveList(bool& cleanup)
|
||||
bool AuthSSLimpl::saveList(bool& cleanup, std::list<RsItem*>& lst)
|
||||
{
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << "AuthSSLimpl::saveList() called" << std::endl ;
|
||||
|
@ -1265,8 +1265,6 @@ std::list<RsItem*> AuthSSLimpl::saveList(bool& cleanup)
|
|||
RsStackMutex stack(sslMtx); /******* LOCKED ******/
|
||||
|
||||
cleanup = true ;
|
||||
std::list<RsItem*> lst ;
|
||||
|
||||
|
||||
// Now save config for network digging strategies
|
||||
RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ;
|
||||
|
@ -1285,10 +1283,10 @@ std::list<RsItem*> AuthSSLimpl::saveList(bool& cleanup)
|
|||
}
|
||||
lst.push_back(vitem);
|
||||
|
||||
return lst ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
bool AuthSSLimpl::loadList(std::list<RsItem*> load)
|
||||
bool AuthSSLimpl::loadList(std::list<RsItem*>& load)
|
||||
{
|
||||
#ifdef AUTHSSL_DEBUG
|
||||
std::cerr << "AuthSSLimpl::loadList() Item Count: " << load.size() << std::endl;
|
||||
|
|
|
@ -217,8 +217,8 @@ virtual bool ValidateCertificate(X509 *x509, std::string &peerId); /* validate
|
|||
/*********************** p3config ******************************/
|
||||
/* Key Functions to be overloaded for Full Configuration */
|
||||
virtual RsSerialiser *setupSerialiser();
|
||||
virtual std::list<RsItem *> saveList(bool &cleanup);
|
||||
virtual bool loadList(std::list<RsItem *> load);
|
||||
virtual bool saveList(bool &cleanup, std::list<RsItem *>& );
|
||||
virtual bool loadList(std::list<RsItem *>& load);
|
||||
/*****************************************************************/
|
||||
|
||||
public: /* SSL specific functions used in pqissl/pqissllistener */
|
||||
|
|
|
@ -904,7 +904,8 @@ bool p3Config::saveConfig()
|
|||
{
|
||||
|
||||
bool cleanup = true;
|
||||
std::list<RsItem *> toSave = saveList(cleanup);
|
||||
std::list<RsItem *> toSave;
|
||||
saveList(cleanup, toSave);
|
||||
|
||||
// temporarily append new to files as these will replace current configuration
|
||||
std::string newCfgFname = Filename() + "_new";
|
||||
|
@ -986,7 +987,8 @@ bool p3Config::saveGlobalConfig()
|
|||
{
|
||||
|
||||
bool cleanup = true;
|
||||
std::list<RsItem *> toSave = saveList(cleanup);
|
||||
std::list<RsItem *> toSave;
|
||||
saveList(cleanup, toSave);
|
||||
|
||||
|
||||
std::string cfg_fname = Filename(); // get configuration file name
|
||||
|
@ -1212,7 +1214,7 @@ RsSerialiser *p3GeneralConfig::setupSerialiser()
|
|||
return rss;
|
||||
}
|
||||
|
||||
std::list<RsItem *> p3GeneralConfig::saveList(bool &cleanup)
|
||||
bool p3GeneralConfig::saveList(bool &cleanup, std::list<RsItem *>& savelist)
|
||||
{
|
||||
RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/
|
||||
|
||||
|
@ -1222,7 +1224,7 @@ std::list<RsItem *> p3GeneralConfig::saveList(bool &cleanup)
|
|||
#endif
|
||||
|
||||
cleanup = true;
|
||||
std::list<RsItem *> savelist;
|
||||
|
||||
|
||||
RsConfigKeyValueSet *item = new RsConfigKeyValueSet();
|
||||
std::map<std::string, std::string>::iterator it;
|
||||
|
@ -1246,11 +1248,11 @@ std::list<RsItem *> p3GeneralConfig::saveList(bool &cleanup)
|
|||
savelist.push_back(item);
|
||||
}
|
||||
|
||||
return savelist;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool p3GeneralConfig::loadList(std::list<RsItem *> load)
|
||||
bool p3GeneralConfig::loadList(std::list<RsItem *>& load)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG
|
||||
std::cerr << "p3GeneralConfig::loadList() count: " << load.size();
|
||||
|
|
|
@ -330,13 +330,13 @@ virtual RsSerialiser *setupSerialiser() = 0;
|
|||
* and vice versa
|
||||
* @return list of config items derived object wants to saves
|
||||
*/
|
||||
virtual std::list<RsItem *> saveList(bool &cleanup) = 0;
|
||||
virtual bool saveList(bool &cleanup, std::list<RsItem *>&) = 0;
|
||||
|
||||
/**
|
||||
* loads up list of configs items for derived object
|
||||
* @param load list of config items to load up
|
||||
*/
|
||||
virtual bool loadList(std::list<RsItem *> load) = 0;
|
||||
virtual bool loadList(std::list<RsItem *>& load) = 0;
|
||||
|
||||
/**
|
||||
* callback for mutex unlocking
|
||||
|
@ -384,8 +384,8 @@ void setSetting(std::string opt, std::string val);
|
|||
|
||||
/* Key Functions to be overloaded for Full Configuration */
|
||||
virtual RsSerialiser *setupSerialiser();
|
||||
virtual std::list<RsItem *> saveList(bool &cleanup);
|
||||
virtual bool loadList(std::list<RsItem *> load);
|
||||
virtual bool saveList(bool &cleanup, std::list<RsItem* >&);
|
||||
virtual bool loadList(std::list<RsItem *>& );
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -3369,10 +3369,9 @@ RsSerialiser *p3ConnectMgr::setupSerialiser()
|
|||
}
|
||||
|
||||
|
||||
std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
|
||||
bool p3ConnectMgr::saveList(bool &cleanup, std::list<RsItem *>& saveData)
|
||||
{
|
||||
/* create a list of current peers */
|
||||
std::list<RsItem *> saveData;
|
||||
cleanup = false;
|
||||
|
||||
connMtx.lock(); /****** MUTEX LOCKED *******/
|
||||
|
@ -3479,7 +3478,7 @@ std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
|
|||
saveData.push_back(*groupIt); // no delete
|
||||
}
|
||||
|
||||
return saveData;
|
||||
return true;
|
||||
}
|
||||
|
||||
void p3ConnectMgr::saveDone()
|
||||
|
@ -3497,7 +3496,7 @@ void p3ConnectMgr::saveDone()
|
|||
connMtx.unlock(); /****** MUTEX UNLOCKED *******/
|
||||
}
|
||||
|
||||
bool p3ConnectMgr::loadList(std::list<RsItem *> load)
|
||||
bool p3ConnectMgr::loadList(std::list<RsItem *>& load)
|
||||
{
|
||||
|
||||
if (load.size() == 0) {
|
||||
|
|
|
@ -390,9 +390,9 @@ bool addAddressIfUnique(std::list<peerConnectAddress> &addrList,
|
|||
/*********************** p3config ******************************/
|
||||
/* Key Functions to be overloaded for Full Configuration */
|
||||
virtual RsSerialiser *setupSerialiser();
|
||||
virtual std::list<RsItem *> saveList(bool &cleanup);
|
||||
virtual bool saveList(bool &cleanup, std::list<RsItem *>&);
|
||||
virtual void saveDone();
|
||||
virtual bool loadList(std::list<RsItem *> load);
|
||||
virtual bool loadList(std::list<RsItem *>& load);
|
||||
/*****************************************************************/
|
||||
|
||||
//void setupOwnNetConfig(RsPeerConfigItem *item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue