mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
stopping hash when the top directory is removed
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4607 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0b33b6fc9d
commit
9b5928453d
@ -880,6 +880,31 @@ void FileIndexMonitor::hashFiles(const std::vector<DirContentToHash>& to_hash)
|
||||
for(uint32_t i=0;running && i<to_hash.size();++i)
|
||||
for(uint32_t j=0;running && j<to_hash[i].fentries.size();++j,++cnt)
|
||||
{
|
||||
#ifdef FIM_DEBUG
|
||||
std::cerr << "Hashing file " << to_hash[i].fentries[j].name << " in dirpath=" << to_hash[i].dirpath << std::endl;
|
||||
#endif
|
||||
|
||||
// Before hashign each file, we test if the directory list has changed. If yes, we trigger
|
||||
// to update directoryMap, so that we can properly test if the current file
|
||||
// still is in a shared directory. If not, we skip it.
|
||||
//
|
||||
if(pendingDirs)
|
||||
{
|
||||
std::cerr << "Pending dir list changed. Updating!" << std::endl;
|
||||
internal_setSharedDirectories() ;
|
||||
}
|
||||
|
||||
{
|
||||
RsStackMutex stack(fiMutex) ; /* LOCKED DIRS */
|
||||
|
||||
if(directoryMap.end() == directoryMap.find(RsDirUtil::getRootDir(to_hash[i].dirpath)))
|
||||
{
|
||||
std::cerr << "Early suppression of root directory. Hash cancelled" << std::endl;
|
||||
total_size -= to_hash[i].fentries[j].size ;
|
||||
continue ;
|
||||
}
|
||||
}
|
||||
|
||||
// This is a very basic progress notification. To be more complete and user friendly, one would
|
||||
// rather send a completion ratio based on the size of files vs/ total size.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user