added some minor feature to channels

- clean up of channels old (> storeperiod) cache file downloads called at rsglobal shutdown

- added extrafilehash and extra-remove to rschannels, so it chooses appropriate way to add files (correct book-keeping)
   - added extra files not copied to chan dir if over 100mb (high overhead)
- added limit to channels auto-download (1gig)




git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2866 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2010-05-08 16:10:34 +00:00
parent 03d0058ca4
commit e1c4992680
6 changed files with 241 additions and 19 deletions

View file

@ -166,8 +166,8 @@ void RsServer::ConfigFinalSave()
void RsServer::rsGlobalShutDown()
{
// TODO: cache should also clean up old files
mChannels->cleanUpOldFiles();
ConfigFinalSave(); // save configuration before exit
mConnMgr->shutdown(); /* Handles UPnP */
}

View file

@ -45,6 +45,7 @@
#include "services/p3Qblog.h"
#include "services/p3blogs.h"
#include "services/p3statusservice.h"
#include "services/p3channels.h"
/* The Main Interface Class - for controlling the server */
@ -174,7 +175,7 @@ class RsServer: public RsControl, public RsThread
p3MsgService *msgSrv;
p3ChatService *chatSrv;
p3StatusService *mStatusSrv;
p3Channels *mChannels;
/* caches (that need ticking) */
p3Ranking *mRanking;
p3Qblog *mQblog;

View file

@ -1104,7 +1104,8 @@ bool RsInit::LoadPassword(std::string id, std::string inPwd)
RsInitConfig::configDir = RsInitConfig::basedir + RsInitConfig::dirSeperator + id;
RsInitConfig::passwd = inPwd;
RsInitConfig::havePasswd = true;
if(inPwd != "")
RsInitConfig::havePasswd = true;
// Create the filename.
std::string basename = RsInitConfig::configDir + RsInitConfig::dirSeperator;
@ -2062,7 +2063,7 @@ int RsServer::StartupRetroShare()
mCacheStrapper -> addCachePair(cp4);
pqih -> addService(mForums); /* This must be also ticked as a service */
p3Channels *mChannels = new p3Channels(RS_SERVICE_TYPE_CHANNEL,
mChannels = new p3Channels(RS_SERVICE_TYPE_CHANNEL,
mCacheStrapper, mCacheTransfer, rsFiles,
localcachedir, remotecachedir, channelsdir);
@ -2213,7 +2214,6 @@ int RsServer::StartupRetroShare()
/**************************************************************************/
/* load caches and secondary data */
/**************************************************************************/