mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-25 17:21:05 -04:00
added an option to follow symbolic links or not, and anti-loop system during directories traversal
This commit is contained in:
parent
cf270d73c0
commit
5f69c9ea1f
13 changed files with 218 additions and 126 deletions
|
@ -273,19 +273,22 @@ cleanup = true;
|
|||
mLocalSharedDirs->getSharedDirectoryList(dirList);
|
||||
}
|
||||
|
||||
for(std::list<SharedDirInfo>::iterator it = dirList.begin(); it != dirList.end(); ++it)
|
||||
{
|
||||
RsFileConfigItem *fi = new RsFileConfigItem();
|
||||
{
|
||||
RS_STACK_MUTEX(mFLSMtx) ;
|
||||
for(std::list<SharedDirInfo>::iterator it = dirList.begin(); it != dirList.end(); ++it)
|
||||
{
|
||||
RsFileConfigItem *fi = new RsFileConfigItem();
|
||||
|
||||
fi->file.path = (*it).filename ;
|
||||
fi->file.name = (*it).virtualname ;
|
||||
fi->flags = (*it).shareflags.toUInt32() ;
|
||||
fi->file.path = (*it).filename ;
|
||||
fi->file.name = (*it).virtualname ;
|
||||
fi->flags = (*it).shareflags.toUInt32() ;
|
||||
|
||||
for(std::list<RsNodeGroupId>::const_iterator it2( (*it).parent_groups.begin());it2!=(*it).parent_groups.end();++it2)
|
||||
fi->parent_groups.ids.insert(*it2) ;
|
||||
for(std::list<RsNodeGroupId>::const_iterator it2( (*it).parent_groups.begin());it2!=(*it).parent_groups.end();++it2)
|
||||
fi->parent_groups.ids.insert(*it2) ;
|
||||
|
||||
sList.push_back(fi);
|
||||
}
|
||||
sList.push_back(fi);
|
||||
}
|
||||
}
|
||||
|
||||
RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet();
|
||||
|
||||
|
@ -314,7 +317,14 @@ cleanup = true;
|
|||
|
||||
rskv->tlvkvs.pairs.push_back(kv);
|
||||
}
|
||||
{
|
||||
RsTlvKeyValue kv;
|
||||
|
||||
kv.key = FOLLOW_SYMLINKS_SS;
|
||||
kv.value = followSymLinks()?"YES":"NO" ;
|
||||
|
||||
rskv->tlvkvs.pairs.push_back(kv);
|
||||
}
|
||||
{
|
||||
RsTlvKeyValue kv;
|
||||
|
||||
|
@ -373,6 +383,10 @@ bool p3FileDatabase::loadList(std::list<RsItem *>& load)
|
|||
if(sscanf(kit->value.c_str(),"%d",&t) == 1)
|
||||
setWatchPeriod(t);
|
||||
}
|
||||
else if(kit->key == FOLLOW_SYMLINKS_SS)
|
||||
{
|
||||
setFollowSymLinks(kit->value == "YES") ;
|
||||
}
|
||||
else if(kit->key == WATCH_FILE_ENABLED_SS)
|
||||
{
|
||||
setWatchEnabled(kit->value == "YES") ;
|
||||
|
@ -891,6 +905,17 @@ bool p3FileDatabase::inDirectoryCheck()
|
|||
RS_STACK_MUTEX(mFLSMtx) ;
|
||||
return mLocalDirWatcher->inDirectoryCheck();
|
||||
}
|
||||
void p3FileDatabase::setFollowSymLinks(bool b)
|
||||
{
|
||||
RS_STACK_MUTEX(mFLSMtx) ;
|
||||
mLocalDirWatcher->setFollowSymLinks(b) ;
|
||||
IndicateConfigChanged();
|
||||
}
|
||||
bool p3FileDatabase::followSymLinks() const
|
||||
{
|
||||
RS_STACK_MUTEX(mFLSMtx) ;
|
||||
return mLocalDirWatcher->followSymLinks() ;
|
||||
}
|
||||
void p3FileDatabase::setWatchEnabled(bool b)
|
||||
{
|
||||
RS_STACK_MUTEX(mFLSMtx) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue