mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 23:55:35 -04:00
Added deferred check of chunks during file transfer. Chunk sha1 sums are requested to the sources and checked for downloaded data.
Validated chunks are shared to other peers. Force check is now very simple since it just turns all chunks into "needs checking" mode and sums are asked to sources. Sources maintain a temporary cache of chunks. Since sums are requested sparsely, this should not affect the sources in terms of performance. We can still imagine precomputing and saving sha1 of chunks while hashing them. For backward compatibility reasons, the following has been setup *temporarily* in this version: - unvalidated chunks are still considered as already obtained, and are shared and saved - force check has been disabled - final file check is maintained - in case of file fail, the old checking mode will be used. All changes for next version are kept in the define 'USE_NEW_CHUNK_CHECKING_CODE' that will be made the default in a few weeks. At start, I expect most chunk to stya yellow during download, until most sources are able to provide chunk hashs. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5019 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7ab5b54266
commit
889a2b2433
31 changed files with 1540 additions and 35 deletions
|
@ -68,12 +68,16 @@ class pqihandler: public P3Interface, public pqiQoS
|
|||
virtual int SendFileChunkMap(RsFileChunkMap *ns);
|
||||
virtual int SendFileCRC32MapRequest(RsFileCRC32MapRequest *ns);
|
||||
virtual int SendFileCRC32Map(RsFileCRC32Map *ns);
|
||||
virtual int SendFileSingleChunkCrcRequest(RsFileSingleChunkCrcRequest *ns);
|
||||
virtual int SendFileSingleChunkCrc(RsFileSingleChunkCrc *ns);
|
||||
virtual RsFileRequest *GetFileRequest();
|
||||
virtual RsFileData *GetFileData();
|
||||
virtual RsFileChunkMapRequest *GetFileChunkMapRequest();
|
||||
virtual RsFileChunkMap *GetFileChunkMap();
|
||||
virtual RsFileCRC32MapRequest *GetFileCRC32MapRequest();
|
||||
virtual RsFileCRC32Map *GetFileCRC32Map();
|
||||
virtual RsFileSingleChunkCrcRequest *GetFileSingleChunkCrcRequest();
|
||||
virtual RsFileSingleChunkCrc *GetFileSingleChunkCrc();
|
||||
|
||||
// Rest of P3Interface
|
||||
virtual int tick();
|
||||
|
@ -112,7 +116,7 @@ class pqihandler: public P3Interface, public pqiQoS
|
|||
SecurityPolicy *globsec;
|
||||
|
||||
// Temporary storage...
|
||||
std::list<RsItem *> in_result, in_search, in_request, in_data, in_service,in_chunkmap,in_chunkmap_request,in_crc32map_request,in_crc32map;
|
||||
std::list<RsItem *> in_result, in_search, in_request, in_data, in_service,in_chunkmap,in_chunkmap_request,in_crc32map_request,in_crc32map,in_singlechunkcrc,in_singlechunkcrc_request;
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue