Improvements to file transfer:

- corrected 2 potential flaws of swarming causing request of unavailable data (This should normally be taken care of on the server side!)
- improved swarming test code with fault simulation
- only ask CRC32 maps to peers that have a complete file.
 


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4947 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-02-16 21:10:46 +00:00
parent 1fea734862
commit 2edb61758b
6 changed files with 85 additions and 41 deletions

View file

@ -84,6 +84,16 @@ class SourceChunksInfo
CompressedChunkMap cmap ; //! map of what the peer has/doens't have
time_t TS ; //! last update time for this info
bool is_full ; //! is the map full ? In such a case, re-asking for it is unnecessary.
// Returns true if the offset is starting in a mapped chunk.
//
bool hasData(uint64_t offset,uint32_t fixed_chunk_size) const
{
if(is_full)
return true ;
return cmap[offset / (uint64_t)fixed_chunk_size ] ;
}
};
class ChunkMap