ftfileprovider.cc - takes care of getting data from a requested file

ftfilecreator.cc -- creates a file, tracks missing chunks, timed out 
chunks etc



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@626 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
cppenthu 2008-07-02 02:36:39 +00:00
parent 93d785b8ff
commit 1db82dee51
7 changed files with 763 additions and 11 deletions

View file

@ -30,13 +30,15 @@
* ftFileProvider.
*
*/
#include <iostream>
#include <stdint.h>
#include "util/rsthreads.h"
class ftFileProvider
{
public:
ftFileProvider(std::string path, uint64_t size, std::string hash);
~ftFileProvider();
virtual ~ftFileProvider();
/* array already allocated -
* just move chunk_size bytes to void *data buffer.
@ -49,7 +51,7 @@ uint64_t getFileSize();
protected:
virtual int initializeFileAttrs();
std::string file_name;
std::string hash;
uint64_t total_size;
@ -61,6 +63,10 @@ protected:
uint64_t req_loc;
uint32_t req_size;
time_t lastTS;
/* Mutex Required for stuff below */
RsMutex ftPMutex;
};