added an optional cache for hashes, so that hashed files are remembered for some days.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3729 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-10-31 20:35:31 +00:00
parent 5cc222d251
commit 630156a5e8
11 changed files with 493 additions and 45 deletions

View file

@ -83,10 +83,6 @@ void ftServer::setConfigDirectory(std::string path)
RsDirUtil::checkCreateDirectory(basecachedir) ;
RsDirUtil::checkCreateDirectory(localcachedir) ;
RsDirUtil::checkCreateDirectory(remotecachedir) ;
//mFiStore -> setCacheDir(remotecachedir);
//mFiMon -> setCacheDir(localcachedir);
}
void ftServer::setP3Interface(P3Interface *pqi)
@ -151,8 +147,6 @@ void ftServer::SetupFtServer(NotifyBase *cb)
mConnMgr->addMonitor(mFtController);
mConnMgr->addMonitor(mCacheStrapper);
// mFtDwlQueue = new ftDwlQueue(mFtController);
return;
}
@ -184,9 +178,6 @@ void ftServer::StartupThreads()
/* Dataplex */
mFtDataplex->start();
// /* Download Queue */
// mFtDwlQueue->start();
/* start own thread */
start();
}
@ -376,11 +367,6 @@ bool ftServer::clearDownload(const std::string hash)
return true ;
}
//void ftServer::getDwlDetails(std::list<DwlDetails> & details)
//{
// mFtDwlQueue->getDwlDetails(details);
//}
bool ftServer::FileDownloadChunksDetails(const std::string& hash,FileChunksInfo& info)
{
return mFtController->getFileDownloadChunksDetails(hash,info);
@ -660,6 +646,26 @@ bool ftServer::removeSharedDirectory(std::string dir)
return true;
}
void ftServer::setRememberHashFiles(bool b)
{
mFiMon->setRememberHashCache(b) ;
}
bool ftServer::rememberHashFiles() const
{
return mFiMon->rememberHashCache() ;
}
void ftServer::setRememberHashFilesDuration(uint32_t days)
{
mFiMon->setRememberHashCacheDuration(days) ;
}
uint32_t ftServer::rememberHashFilesDuration() const
{
return mFiMon->rememberHashCacheDuration() ;
}
void ftServer::clearHashCache()
{
mFiMon->clearHashCache() ;
}
void ftServer::setShareDownloadDirectory(bool value)
{
@ -1250,7 +1256,6 @@ bool ftServer::addConfiguration(p3ConfigMgr *cfgmgr)
cfgmgr->addConfiguration("ft_shared.cfg", mFiMon);
cfgmgr->addConfiguration("ft_extra.cfg", mFtExtra);
cfgmgr->addConfiguration("ft_transfers.cfg", mFtController);
// cfgmgr->addConfiguration("ft_dwlqueue.cfg", mFtDwlQueue);
return true;
}