mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Commit of the new UDP Connection methods and
the rewrite of the retroshare core networking stack. This check-in commits the changes to the dbase code. only minor changes: rename loadCache->loadLocalCache to avoid clash. switch to new monitoring system in cachestrapper. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@307 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6435357c07
commit
2780be3931
@ -83,7 +83,7 @@ void CacheSource::unlockData()
|
||||
}
|
||||
|
||||
/* to be overloaded for inherited Classes */
|
||||
bool CacheSource::loadCache(const CacheData &data)
|
||||
bool CacheSource::loadLocalCache(const CacheData &data)
|
||||
{
|
||||
return refreshCache(data);
|
||||
}
|
||||
@ -450,6 +450,8 @@ void CacheStore::locked_storeCacheEntry(const CacheData &data)
|
||||
CacheStrapper::CacheStrapper(RsPeerId id, time_t period)
|
||||
:ownId(id), queryPeriod(period)
|
||||
{
|
||||
/* add OwnId */
|
||||
addPeerId(ownId);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -460,8 +462,9 @@ void CacheStrapper::addCachePair(CachePair set)
|
||||
}
|
||||
|
||||
|
||||
/* from pqimonclient */
|
||||
void CacheStrapper::monUpdate(const std::list<pqipeer> &plist)
|
||||
/**************** from pqimonclient ********************/
|
||||
|
||||
void CacheStrapper::statusChange(const std::list<pqipeer> &plist)
|
||||
{
|
||||
std::list<pqipeer>::const_iterator it;
|
||||
std::map<RsPeerId, CacheTS>::iterator mit;
|
||||
@ -474,6 +477,8 @@ void CacheStrapper::monUpdate(const std::list<pqipeer> &plist)
|
||||
}
|
||||
}
|
||||
|
||||
/**************** from pqimonclient ********************/
|
||||
|
||||
|
||||
void CacheStrapper::addPeerId(RsPeerId pid)
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ virtual bool cachesAvailable(RsPeerId pid, std::map<CacheId, CacheData> &ids);
|
||||
* configuration file....
|
||||
* to be overloaded by inherited class
|
||||
*/
|
||||
virtual bool loadCache(const CacheData &data);
|
||||
virtual bool loadLocalCache(const CacheData &data);
|
||||
|
||||
/* control Caches available */
|
||||
bool refreshCache(const CacheData &data);
|
||||
@ -271,16 +271,17 @@ class CacheTS
|
||||
time_t answer;
|
||||
};
|
||||
|
||||
#include "pqi/pqimon.h"
|
||||
#include "pqi/pqimonitor.h"
|
||||
|
||||
class CacheStrapper: public pqimonclient
|
||||
class CacheStrapper: public pqiMonitor
|
||||
{
|
||||
public:
|
||||
CacheStrapper(RsPeerId id, time_t period);
|
||||
virtual ~CacheStrapper() { return; }
|
||||
|
||||
/* from pqimonclient */
|
||||
virtual void monUpdate(const std::list<pqipeer> &plist);
|
||||
/************* from pqiMonitor *******************/
|
||||
virtual void statusChange(const std::list<pqipeer> &plist);
|
||||
/************* from pqiMonitor *******************/
|
||||
|
||||
void addCachePair(CachePair pair);
|
||||
|
||||
|
@ -99,7 +99,7 @@ bool FileIndexMonitor::findLocalFile(std::string hash,
|
||||
}
|
||||
|
||||
|
||||
bool FileIndexMonitor::loadCache(const CacheData &data) /* called with stored data */
|
||||
bool FileIndexMonitor::loadLocalCache(const CacheData &data) /* called with stored data */
|
||||
{
|
||||
bool ok = false;
|
||||
|
||||
|
@ -77,7 +77,7 @@ bool findLocalFile(std::string hash, std::string &fullpath, uint64_t &size);
|
||||
|
||||
/* Interacting with CacheSource */
|
||||
/* overloaded from CacheSource */
|
||||
virtual bool loadCache(const CacheData &data); /* called with stored data */
|
||||
virtual bool loadLocalCache(const CacheData &data); /* called with stored data */
|
||||
bool updateCache(const CacheData &data); /* we call when we have a new cache for others */
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user