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:
drbob 2008-01-25 06:42:55 +00:00
parent 6435357c07
commit 2780be3931
4 changed files with 16 additions and 10 deletions

View File

@ -83,7 +83,7 @@ void CacheSource::unlockData()
} }
/* to be overloaded for inherited Classes */ /* to be overloaded for inherited Classes */
bool CacheSource::loadCache(const CacheData &data) bool CacheSource::loadLocalCache(const CacheData &data)
{ {
return refreshCache(data); return refreshCache(data);
} }
@ -450,6 +450,8 @@ void CacheStore::locked_storeCacheEntry(const CacheData &data)
CacheStrapper::CacheStrapper(RsPeerId id, time_t period) CacheStrapper::CacheStrapper(RsPeerId id, time_t period)
:ownId(id), queryPeriod(period) :ownId(id), queryPeriod(period)
{ {
/* add OwnId */
addPeerId(ownId);
return; return;
} }
@ -460,8 +462,9 @@ void CacheStrapper::addCachePair(CachePair set)
} }
/* from pqimonclient */ /**************** from pqimonclient ********************/
void CacheStrapper::monUpdate(const std::list<pqipeer> &plist)
void CacheStrapper::statusChange(const std::list<pqipeer> &plist)
{ {
std::list<pqipeer>::const_iterator it; std::list<pqipeer>::const_iterator it;
std::map<RsPeerId, CacheTS>::iterator mit; 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) void CacheStrapper::addPeerId(RsPeerId pid)
{ {

View File

@ -146,7 +146,7 @@ virtual bool cachesAvailable(RsPeerId pid, std::map<CacheId, CacheData> &ids);
* configuration file.... * configuration file....
* to be overloaded by inherited class * to be overloaded by inherited class
*/ */
virtual bool loadCache(const CacheData &data); virtual bool loadLocalCache(const CacheData &data);
/* control Caches available */ /* control Caches available */
bool refreshCache(const CacheData &data); bool refreshCache(const CacheData &data);
@ -271,16 +271,17 @@ class CacheTS
time_t answer; time_t answer;
}; };
#include "pqi/pqimon.h" #include "pqi/pqimonitor.h"
class CacheStrapper: public pqimonclient class CacheStrapper: public pqiMonitor
{ {
public: public:
CacheStrapper(RsPeerId id, time_t period); CacheStrapper(RsPeerId id, time_t period);
virtual ~CacheStrapper() { return; } virtual ~CacheStrapper() { return; }
/* from pqimonclient */ /************* from pqiMonitor *******************/
virtual void monUpdate(const std::list<pqipeer> &plist); virtual void statusChange(const std::list<pqipeer> &plist);
/************* from pqiMonitor *******************/
void addCachePair(CachePair pair); void addCachePair(CachePair pair);

View File

@ -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; bool ok = false;

View File

@ -77,7 +77,7 @@ bool findLocalFile(std::string hash, std::string &fullpath, uint64_t &size);
/* Interacting with CacheSource */ /* Interacting with CacheSource */
/* overloaded from 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 */ bool updateCache(const CacheData &data); /* we call when we have a new cache for others */