mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 08:05:18 -04:00
* Added Configurations to new file transfer.
* Enabled config in p3file-startup.cc * Enabled resumeTransfers * Added new RsFileConfigItem to serialiser. * extended ftFiMonitor to use Configuration. * bug fix to add/remove Shared Dirs. * Increased Channel/forum periods to 3/12 months. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@806 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
941e59f6e9
commit
66bf56207d
18 changed files with 768 additions and 111 deletions
|
@ -51,6 +51,7 @@ class ftDataMultiplex;
|
|||
#include "pqi/p3cfgmgr.h"
|
||||
|
||||
#include "rsiface/rsfiles.h"
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -94,6 +95,7 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu
|
|||
ftController(CacheStrapper *cs, ftDataMultiplex *dm, std::string configDir);
|
||||
|
||||
void setFtSearchNExtra(ftSearch *, ftExtraList *);
|
||||
bool ResumeTransfers();
|
||||
|
||||
virtual void run();
|
||||
|
||||
|
@ -120,6 +122,7 @@ std::string getDownloadDirectory();
|
|||
std::string getPartialsDirectory();
|
||||
bool FileDetails(std::string hash, FileInfo &info);
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/********************** Cache Transfer *************************/
|
||||
/***************************************************************/
|
||||
|
@ -143,6 +146,8 @@ virtual void statusChange(const std::list<pqipeer> &plist);
|
|||
virtual RsSerialiser *setupSerialiser();
|
||||
virtual std::list<RsItem *> saveList(bool &cleanup);
|
||||
virtual bool loadList(std::list<RsItem *> load);
|
||||
bool loadConfigMap(std::map<std::string, std::string> &configMap);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
@ -179,6 +184,9 @@ bool setPeerState(ftTransferModule *tm, std::string id,
|
|||
std::list<std::string> mStreamQueue;
|
||||
std::list<std::string> mFastQueue;
|
||||
|
||||
/* Config Load */
|
||||
std::list<RsFileTransfer *> mResumeTransferList;
|
||||
|
||||
/* callback list (for File Completion) */
|
||||
RsMutex doneMutex;
|
||||
std::list<std::string> mDone;
|
||||
|
@ -186,37 +194,3 @@ bool setPeerState(ftTransferModule *tm, std::string id,
|
|||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
class CacheTransfer
|
||||
{
|
||||
public:
|
||||
CacheTransfer(CacheStrapper *cs) :strapper(cs) { return; }
|
||||
virtual ~CacheTransfer() {}
|
||||
|
||||
/* upload side of things .... searches through CacheStrapper. */
|
||||
bool FindCacheFile(std::string hash, std::string &path, uint64_t &size);
|
||||
|
||||
|
||||
/* At the download side RequestCache() => overloaded RequestCacheFile()
|
||||
* the class should then call CompletedCache() or FailedCache()
|
||||
*/
|
||||
|
||||
bool RequestCache(CacheData &data, CacheStore *cbStore); /* request from CacheStore */
|
||||
|
||||
protected:
|
||||
/* to be overloaded */
|
||||
virtual bool RequestCacheFile(RsPeerId id, std::string path, std::string hash, uint64_t size);
|
||||
virtual bool CancelCacheFile(RsPeerId id, std::string path, std::string hash, uint64_t size);
|
||||
|
||||
bool CompletedCache(std::string hash); /* internal completion -> does cb */
|
||||
bool FailedCache(std::string hash); /* internal completion -> does cb */
|
||||
|
||||
private:
|
||||
|
||||
CacheStrapper *strapper;
|
||||
|
||||
std::map<std::string, CacheData> cbData;
|
||||
std::map<std::string, CacheStore *> cbStores;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue