Iproved file list handling:

- Implemented correct cacheData send to clients usign constant subid value.
- At start, the association between peers and available file list is always recomputed
- overloaded cacheAvailable() and refreshCache() in FileIndexMonitor
- added callback in rsFiles to force re-generating cache items when group layout has changed
- force re-sent file lists when moving peers between groups in the GUI
(Fixes group leaking problem) Needs full recompilation of libretroshare.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5813 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-11-12 22:51:27 +00:00
parent 03dbf7bc1b
commit 454daf1981
10 changed files with 133 additions and 43 deletions

View file

@ -92,7 +92,7 @@ bool CacheSource::loadLocalCache(const CacheData &data)
}
/* control Caches available */
bool CacheSource::refreshCache(const CacheData &data,const std::list<std::string>& destination_peers)
bool CacheSource::refreshCache(const CacheData &data,const std::set<std::string>& destination_peers)
{
bool ret = false;
{
@ -599,23 +599,27 @@ void CacheStrapper::statusChange(const std::list<pqipeer> &plist)
/**************** from pqimonclient ********************/
void CacheStrapper::refreshCache(const CacheData &data,const std::list<std::string>& destination_peers)
void CacheStrapper::refreshCache(const CacheData &data,const std::set<std::string>& destination_peers)
{
/* we've received an update
* send to all online peers + self
* send to all online peers + self intersected with online peers.
*/
#ifdef CS_DEBUG
std::cerr << "CacheStrapper::refreshCache() : " << data << std::endl;
#endif
std::list<std::string> ids;
mLinkMgr->getOnlineList(ids);
ids.push_back(mLinkMgr->getOwnId()) ;
RsStackMutex stack(csMtx); /******* LOCK STACK MUTEX *********/
for(std::list<std::string>::const_iterator it = destination_peers.begin(); it != destination_peers.end(); ++it)
{
for(std::list<std::string>::const_iterator it = ids.begin(); it != ids.end(); ++it)
if(destination_peers.find(*it) != destination_peers.end())
{
#ifdef CS_DEBUG
std::cerr << "CacheStrapper::refreshCache() Send To: " << *it << std::endl;
std::cerr << "CacheStrapper::refreshCache() Send To: " << *it << std::endl;
#endif
mCacheUpdates.push_back(std::make_pair(*it, data));
}
mCacheUpdates.push_back(std::make_pair(*it, data));
}
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
}
@ -633,7 +637,12 @@ void CacheStrapper::refreshCache(const CacheData &data)
mLinkMgr->getOnlineList(ids);
ids.push_back(mLinkMgr->getOwnId()) ;
refreshCache(data,ids) ;
{
RsStackMutex stack(csMtx); /******* LOCK STACK MUTEX *********/
for(std::list<std::string>::const_iterator it = ids.begin(); it != ids.end(); ++it)
mCacheUpdates.push_back(std::make_pair(*it, data));
}
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
}
void CacheStrapper::refreshCacheStore(const CacheData & /* data */ )