mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
More Improvements to FileTransfer:
* Added TlvShallowClear() to serialisers * Added RsQueueThread for periodic queue processes. * Completed ftDataMultiplex which replaces ftServer/ClientModules. * Added Server Queue / Thread to ftDataMultiplex. * Added ftdataplextest to exercise ftDataMultiplex. * Generalised ftFileSearch to handle an array of ftSearch classes. * Tweaked rsfiles.h #defines to match new ftFileSearch scheme. * Added Generic ftData Interfaces for Testing. * added ftDataSend/Recv Interfaces to ftServer + ftDataMultiplex respectively. * Completed much of ftServer (External Interface), but not yet done. * Extra debugging and small changes to ftExtraList * Integrated new ftTransferModule with minor interface changes. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@660 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d584516859
commit
5c6e558942
22 changed files with 1355 additions and 326 deletions
|
@ -51,19 +51,22 @@ const uint32_t RS_FILE_CTRL_STREAM_VIDEO = 0x0006;
|
|||
|
||||
/************************************
|
||||
* Used To indicate where to search.
|
||||
*
|
||||
* The Order of these is very important,
|
||||
* it specifies the search order too.
|
||||
*
|
||||
*/
|
||||
|
||||
const uint32_t RS_FILE_HINTS_MASK = 0x00ff;
|
||||
const uint32_t RS_FILE_HINTS_MASK = 0x00ffffff;
|
||||
|
||||
const uint32_t RS_FILE_HINTS_CACHE = 0x0001;
|
||||
const uint32_t RS_FILE_HINTS_EXTRA = 0x0002;
|
||||
const uint32_t RS_FILE_HINTS_LOCAL = 0x0004;
|
||||
const uint32_t RS_FILE_HINTS_REMOTE = 0x0008;
|
||||
const uint32_t RS_FILE_HINTS_DOWNLOAD = 0x0010;
|
||||
const uint32_t RS_FILE_HINTS_UPLOAD = 0x0020;
|
||||
|
||||
const uint32_t RS_FILE_HINTS_SPEC_ONLY = 0x1000;
|
||||
const uint32_t RS_FILE_HINTS_CACHE = 0x00000001;
|
||||
const uint32_t RS_FILE_HINTS_EXTRA = 0x00000002;
|
||||
const uint32_t RS_FILE_HINTS_LOCAL = 0x00000004;
|
||||
const uint32_t RS_FILE_HINTS_REMOTE = 0x00000008;
|
||||
const uint32_t RS_FILE_HINTS_DOWNLOAD = 0x00000010;
|
||||
const uint32_t RS_FILE_HINTS_UPLOAD = 0x00000020;
|
||||
|
||||
const uint32_t RS_FILE_HINTS_SPEC_ONLY = 0x01000000;
|
||||
|
||||
|
||||
const uint32_t RS_FILE_EXTRA_DELETE = 0x0010;
|
||||
|
@ -79,43 +82,27 @@ virtual ~RsFiles() { return; }
|
|||
/****************************************/
|
||||
/* download */
|
||||
|
||||
/* Required Interfaces ......
|
||||
*
|
||||
* 1) Access to downloading / uploading files.
|
||||
*/
|
||||
|
||||
/* get Details of File Transfers */
|
||||
virtual bool FileDownloads(std::list<std::string> &hashs) = 0;
|
||||
virtual bool FileUploads(std::list<std::string> &hashs) = 0;
|
||||
virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) = 0;
|
||||
|
||||
|
||||
/*
|
||||
* 2) Control of Downloads.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/***
|
||||
* Control of Downloads.
|
||||
***/
|
||||
virtual bool FileRequest(std::string fname, std::string hash,
|
||||
uint32_t size, std::string dest, uint32_t flags) = 0;
|
||||
virtual bool FileCancel(std::string hash) = 0;
|
||||
virtual bool FileControl(std::string hash, uint32_t flags) = 0;
|
||||
virtual bool FileClearCompleted() = 0;
|
||||
|
||||
/***
|
||||
* Download / Upload Details.
|
||||
***/
|
||||
virtual bool FileDownloads(std::list<std::string> &hashs) = 0;
|
||||
virtual bool FileUploads(std::list<std::string> &hashs) = 0;
|
||||
virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) = 0;
|
||||
|
||||
/*
|
||||
* 3) Addition of Extra Files... From File System
|
||||
* These are Hashed and stored in the 'Hidden Files' section
|
||||
* which can only be accessed if you know the hash.
|
||||
*
|
||||
* FileHash is called to start the hashing process,
|
||||
* and add the file to the HiddenStore.
|
||||
*
|
||||
* FileHashStatus is called to lookup files
|
||||
* and see if the hashing is completed.
|
||||
*/
|
||||
|
||||
/* Access ftExtraList - Details */
|
||||
/***
|
||||
* Extra List Access
|
||||
***/
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint32_t size,
|
||||
uint32_t period, uint32_t flags) = 0;
|
||||
virtual bool ExtraFileRemove(std::string hash, uint32_t flags) = 0;
|
||||
|
@ -124,25 +111,25 @@ virtual bool ExtraFileHash(std::string localpath,
|
|||
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info) = 0;
|
||||
|
||||
|
||||
/*
|
||||
* 4) Search and Listing Interface
|
||||
/***
|
||||
* Directory Listing / Search Interface
|
||||
*/
|
||||
|
||||
/* Directory Listing / Search Interface */
|
||||
virtual int RequestDirDetails(std::string uid, std::string path, DirDetails &details) = 0;
|
||||
virtual int RequestDirDetails(void *ref, DirDetails &details, uint32_t flags) = 0;
|
||||
|
||||
virtual int SearchKeywords(std::list<std::string> keywords, std::list<FileDetail> &results) = 0;
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<FileDetail> &results) = 0;
|
||||
|
||||
/*
|
||||
* 5) Directory Control / Shared Files Utility Functions.
|
||||
*/
|
||||
|
||||
/***
|
||||
* Utility Functions.
|
||||
***/
|
||||
virtual bool ConvertSharedFilePath(std::string path, std::string &fullpath) = 0;
|
||||
virtual void ForceDirectoryCheck() = 0;
|
||||
virtual bool InDirectoryCheck() = 0;
|
||||
|
||||
/***
|
||||
* Directory Control
|
||||
***/
|
||||
virtual void setDownloadDirectory(std::string path) = 0;
|
||||
virtual void setPartialsDirectory(std::string path) = 0;
|
||||
virtual std::string getDownloadDirectory() = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue