mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 17:28:41 -04:00
removed unused updateHash() functions in directory_storage. Fixed a bug that caused H(H(F)) to not be recomputed at start, causing e2e encryption to fail in some cases.
This commit is contained in:
parent
81dffbed84
commit
08294deeba
4 changed files with 28 additions and 38 deletions
|
@ -160,19 +160,6 @@ void DirectoryStorage::locked_check()
|
|||
std::cerr << "Check error: " << error << std::endl;
|
||||
}
|
||||
|
||||
bool DirectoryStorage::updateFile(const EntryIndex& index,const RsFileHash& hash,const std::string& fname, uint64_t size,time_t modf_time)
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
mChanged = true ;
|
||||
return mFileHierarchy->updateFile(index,hash,fname,size,modf_time);
|
||||
}
|
||||
bool DirectoryStorage::updateHash(const EntryIndex& index,const RsFileHash& hash)
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
mChanged = true ;
|
||||
return mFileHierarchy->updateHash(index,hash);
|
||||
}
|
||||
|
||||
void DirectoryStorage::getStatistics(SharedDirStats& stats)
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
|
@ -502,14 +489,18 @@ void LocalDirectoryStorage::updateTimeStamps()
|
|||
#endif
|
||||
}
|
||||
}
|
||||
bool LocalDirectoryStorage::updateHash(const EntryIndex& index,const RsFileHash& hash)
|
||||
bool LocalDirectoryStorage::updateHash(const EntryIndex& index, const RsFileHash& hash, bool update_internal_hierarchy)
|
||||
{
|
||||
{
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||
|
||||
mEncryptedHashes[makeEncryptedHash(hash)] = hash ;
|
||||
}
|
||||
return mFileHierarchy->updateHash(index,hash);
|
||||
mEncryptedHashes[makeEncryptedHash(hash)] = hash ;
|
||||
mChanged = true ;
|
||||
|
||||
#ifdef DEBUG_LOCAL_DIRECTORY_STORAGE
|
||||
std::cerr << "Updating index of hash " << hash << " update_internal=" << update_internal_hierarchy << std::endl;
|
||||
#endif
|
||||
|
||||
return (!update_internal_hierarchy)|| mFileHierarchy->updateHash(index,hash);
|
||||
}
|
||||
std::string LocalDirectoryStorage::locked_findRealRootFromVirtualFilename(const std::string& virtual_rootdir) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue