mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 08:05:18 -04:00
First implementation of per-chunk CRC32 check. This is triggered
- by the right-click+Force Check on files. - when a global hash on a downloaded file does not match the announced hash. When a CRC map check is ordered, the CRC map is requested to one of the sources for the current file download. When received, all downloaded chunks are checked w.r.t the reference CRC and marked as not done if the CRCs do not match. The exchange of CRC32 map and requests has been tested, as well as CRC map checking during download (force check). To be implemented soon: - caching of CRC32 maps (although these are fast to compute) - CRC32 map packets for normal downloads. For now these work only for turtle tunnels. - handling of errors if the CRC never comes. For now, the download will stay stuck in "Checking..." mode. So, don't play too much with the force check feature for now... git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3310 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
db034b026f
commit
8bfc74485a
27 changed files with 1012 additions and 118 deletions
|
@ -99,9 +99,9 @@ class ftFileControl
|
|||
class ftPendingRequest
|
||||
{
|
||||
public:
|
||||
ftPendingRequest(std::string fname, std::string hash,
|
||||
uint64_t size, std::string dest, uint32_t flags,
|
||||
std::list<std::string> &srcIds)
|
||||
ftPendingRequest(const std::string& fname, const std::string& hash,
|
||||
uint64_t size, const std::string& dest, uint32_t flags,
|
||||
const std::list<std::string> &srcIds)
|
||||
: mName(fname), mHash(hash), mSize(size),
|
||||
mDest(dest), mFlags(flags),mSrcIds(srcIds) { return; }
|
||||
|
||||
|
@ -137,9 +137,9 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu
|
|||
/********************** Controller Access **********************/
|
||||
/***************************************************************/
|
||||
|
||||
bool FileRequest(std::string fname, std::string hash,
|
||||
uint64_t size, std::string dest, uint32_t flags,
|
||||
std::list<std::string> &sourceIds);
|
||||
bool FileRequest(const std::string& fname, const std::string& hash,
|
||||
uint64_t size, const std::string& dest, uint32_t flags,
|
||||
const std::list<std::string> &sourceIds);
|
||||
|
||||
/// Do we already have this file, either in download or in file lists ?
|
||||
bool alreadyHaveFile(const std::string& hash) ;
|
||||
|
@ -150,7 +150,7 @@ class ftController: public CacheTransfer, public RsThread, public pqiMonitor, pu
|
|||
uint32_t freeDiskSpaceLimit() const ;
|
||||
void setFreeDiskSpaceLimit(uint32_t size_in_mb) ;
|
||||
|
||||
bool FileCancel(std::string hash);
|
||||
bool FileCancel(const std::string& hash);
|
||||
bool FileControl(const std::string& hash, uint32_t flags);
|
||||
bool FileClearCompleted();
|
||||
bool FlagFileComplete(std::string hash);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue