mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-26 07:11:08 -04:00
merge of branch v0.6-idclean 7180
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7187 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7815efb16f
commit
0f29d28b1b
397 changed files with 6503 additions and 5702 deletions
|
@ -47,12 +47,12 @@ class ftFileCreator: public ftFileProvider
|
|||
{
|
||||
public:
|
||||
|
||||
ftFileCreator(const std::string& savepath, uint64_t size, const std::string& hash,bool assume_availability);
|
||||
ftFileCreator(const std::string& savepath, uint64_t size, const RsFileHash& hash,bool assume_availability);
|
||||
|
||||
~ftFileCreator();
|
||||
|
||||
/* overloaded from FileProvider */
|
||||
virtual bool getFileData(const std::string& peer_id,uint64_t offset, uint32_t &chunk_size, void *data);
|
||||
virtual bool getFileData(const RsPeerId& peer_id,uint64_t offset, uint32_t &chunk_size, void *data);
|
||||
bool finished() ;
|
||||
uint64_t getRecvd();
|
||||
|
||||
|
@ -69,7 +69,7 @@ class ftFileCreator: public ftFileProvider
|
|||
// long time. Therefore, we must pay attention not to call this function
|
||||
// at a time file_name nor hash can be modified, which is quite easy.
|
||||
|
||||
bool hashReceivedData(std::string& hash) ;
|
||||
bool hashReceivedData(RsFileHash& hash) ;
|
||||
|
||||
// Sets all chunks to checking state
|
||||
//
|
||||
|
@ -91,7 +91,7 @@ class ftFileCreator: public ftFileProvider
|
|||
// - no chunkmap info is available. In such a case, the chunk info is irrelevant and false is returned.
|
||||
// - the chunk info is too old. In tis case, true is returned, and the chunks info can be used.
|
||||
//
|
||||
bool getMissingChunk(const std::string& peer_id,uint32_t size_hint,uint64_t& offset, uint32_t& size,bool& is_chunk_map_too_old);
|
||||
bool getMissingChunk(const RsPeerId& peer_id,uint32_t size_hint,uint64_t& offset, uint32_t& size,bool& is_chunk_map_too_old);
|
||||
|
||||
// Takes care of purging any inactive chunks. This should be called regularly, because some peers may disconnect
|
||||
// and let inactive chunks not finished.
|
||||
|
@ -99,11 +99,11 @@ class ftFileCreator: public ftFileProvider
|
|||
void removeInactiveChunks() ;
|
||||
|
||||
// removes the designated file source from the chunkmap.
|
||||
void removeFileSource(const std::string& peer_id) ;
|
||||
void removeFileSource(const RsPeerId& peer_id) ;
|
||||
|
||||
// Get all available sources for this chunk
|
||||
//
|
||||
void getSourcesList(uint32_t chunk_number,std::vector<std::string>& sources) ;
|
||||
void getSourcesList(uint32_t chunk_number,std::vector<RsPeerId>& sources) ;
|
||||
|
||||
// Returns resets the time stamp of the last data receive.
|
||||
time_t lastRecvTimeStamp() ;
|
||||
|
@ -124,11 +124,11 @@ class ftFileCreator: public ftFileProvider
|
|||
|
||||
// This is called when receiving the availability map from a source peer, for the file being handled.
|
||||
//
|
||||
void setSourceMap(const std::string& peer_id,const CompressedChunkMap& map) ;
|
||||
void setSourceMap(const RsPeerId& peer_id,const CompressedChunkMap& map) ;
|
||||
|
||||
// Returns true id the given file source is complete.
|
||||
//
|
||||
bool sourceIsComplete(const std::string& peer_id) ;
|
||||
bool sourceIsComplete(const RsPeerId& peer_id) ;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -146,7 +146,7 @@ class ftFileCreator: public ftFileProvider
|
|||
uint64_t mEnd;
|
||||
|
||||
std::map<uint64_t, ftChunk> mChunks;
|
||||
std::map<std::string,ZeroInitCounter> mChunksPerPeer ;
|
||||
std::map<RsPeerId,ZeroInitCounter> mChunksPerPeer ;
|
||||
|
||||
ChunkMap chunkMap ;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue