mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 01:08:50 -04:00
added method in ftServer to allow retrieving data from shared/downloaded files (patch from electron, modified)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7999 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
400d3179e8
commit
a1b36cd530
13 changed files with 140 additions and 18 deletions
|
@ -41,7 +41,16 @@ class ftFileProvider
|
|||
ftFileProvider(const std::string& path, uint64_t size, const RsFileHash& hash);
|
||||
virtual ~ftFileProvider();
|
||||
|
||||
virtual bool getFileData(const RsPeerId& peer_id,uint64_t offset, uint32_t &chunk_size, void *data);
|
||||
/**
|
||||
* read a block of data from the file
|
||||
* @param peer_id for the uploading stats: to which peer the data will be send
|
||||
* @param offset begin of the requested data range
|
||||
* @param chunk_size how many bytes to read. Will be set to the number of valid bytes in data on return.
|
||||
* @param data pointer to a buffer of size chunk_size. Contains the data on success.
|
||||
* @param allow_unverified for ftFileCreator: set to true to return data from unverified chunks. Use it if you want data asap.
|
||||
* @return true if data was read
|
||||
*/
|
||||
virtual bool getFileData(const RsPeerId& peer_id,uint64_t offset, uint32_t &chunk_size, void *data, bool allow_unverified = false);
|
||||
virtual bool FileDetails(FileInfo &info);
|
||||
RsFileHash getHash();
|
||||
uint64_t getFileSize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue