mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 13:30:36 -04:00
Completed most of ftserver class.
Also changes to make everything fit together. changes to Interface to support srcId list. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@675 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d7e1a90c28
commit
189dcbb482
15 changed files with 512 additions and 166 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "ftfileprovider.h"
|
||||
|
||||
#include "util/rsdir.h"
|
||||
|
||||
ftFileProvider::ftFileProvider(std::string path, uint64_t size, std::string
|
||||
hash) : total_size(size), hash(hash), file_name(path), fd(NULL) {
|
||||
|
||||
|
@ -21,6 +23,19 @@ uint64_t ftFileProvider::getFileSize()
|
|||
return total_size;
|
||||
}
|
||||
|
||||
bool ftFileProvider::FileDetails(FileInfo &info)
|
||||
{
|
||||
info.hash = hash;
|
||||
info.size = total_size;
|
||||
info.path = file_name;
|
||||
info.fname = RsDirUtil::getTopDir(file_name);
|
||||
|
||||
/* Use req_loc / req_size to estimate data rate */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ftFileProvider::getFileData(uint64_t offset, uint32_t chunk_size, void *data)
|
||||
{
|
||||
RsStackMutex stack(ftPMutex); /********** STACK LOCKED MTX ******/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue