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:
drbob 2008-08-09 17:03:24 +00:00
parent d7e1a90c28
commit 189dcbb482
15 changed files with 512 additions and 166 deletions

View file

@ -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 ******/