mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-10 03:49:51 -05:00
prevent storage for hash of files that cannot be hashed
This commit is contained in:
parent
ddc870c6b1
commit
bb4b577768
@ -150,14 +150,12 @@ void HashStorage::data_tick()
|
|||||||
|
|
||||||
RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_HASH_FILE, tmpout) ;
|
RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_HASH_FILE, tmpout) ;
|
||||||
|
|
||||||
if(!RsDirUtil::getFileHash(job.full_path, hash,size, this))
|
if(RsDirUtil::getFileHash(job.full_path, hash,size, this))
|
||||||
std::cerr << "ERROR: cannot hash file " << job.full_path << std::endl;
|
{
|
||||||
else
|
// store the result
|
||||||
|
|
||||||
std::cerr << "done."<< std::endl;
|
std::cerr << "done."<< std::endl;
|
||||||
|
|
||||||
// store the result
|
|
||||||
|
|
||||||
{
|
|
||||||
RS_STACK_MUTEX(mHashMtx) ;
|
RS_STACK_MUTEX(mHashMtx) ;
|
||||||
HashStorageInfo& info(mFiles[job.full_path]);
|
HashStorageInfo& info(mFiles[job.full_path]);
|
||||||
|
|
||||||
@ -168,9 +166,12 @@ void HashStorage::data_tick()
|
|||||||
info.hash = hash;
|
info.hash = hash;
|
||||||
|
|
||||||
mChanged = true ;
|
mChanged = true ;
|
||||||
++mHashCounter ;
|
|
||||||
mTotalHashedSize += size ;
|
mTotalHashedSize += size ;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
std::cerr << "ERROR: cannot hash file " << job.full_path << std::endl;
|
||||||
|
|
||||||
|
++mHashCounter ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// call the client
|
// call the client
|
||||||
|
Loading…
x
Reference in New Issue
Block a user