mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed compilation with new RsNodeGroupId
This commit is contained in:
parent
ade6017f74
commit
f191fe675d
@ -913,10 +913,10 @@ void LocalDirectoryStorage::getSharedDirectoryList(std::list<SharedDirInfo>& lst
|
|||||||
lst.push_back(it->second) ;
|
lst.push_back(it->second) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sameLists(const std::list<std::string>& l1,const std::list<std::string>& l2)
|
static bool sameLists(const std::list<RsNodeGroupId>& l1,const std::list<RsNodeGroupId>& l2)
|
||||||
{
|
{
|
||||||
std::list<std::string>::const_iterator it1(l1.begin()) ;
|
std::list<RsNodeGroupId>::const_iterator it1(l1.begin()) ;
|
||||||
std::list<std::string>::const_iterator it2(l2.begin()) ;
|
std::list<RsNodeGroupId>::const_iterator it2(l2.begin()) ;
|
||||||
|
|
||||||
for(; (it1!=l1.end() && it2!=l2.end());++it1,++it2)
|
for(; (it1!=l1.end() && it2!=l2.end());++it1,++it2)
|
||||||
if(*it1 != *it2)
|
if(*it1 != *it2)
|
||||||
@ -1004,13 +1004,13 @@ bool LocalDirectoryStorage::extractData(const EntryIndex& indx,DirDetails& d)
|
|||||||
return getFileSharingPermissions(indx,d.flags,d.parent_groups) ;
|
return getFileSharingPermissions(indx,d.flags,d.parent_groups) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocalDirectoryStorage::getFileSharingPermissions(const EntryIndex& indx,FileStorageFlags& flags,std::list<std::string>& parent_groups)
|
bool LocalDirectoryStorage::getFileSharingPermissions(const EntryIndex& indx,FileStorageFlags& flags,std::list<RsNodeGroupId>& parent_groups)
|
||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mDirStorageMtx) ;
|
RS_STACK_MUTEX(mDirStorageMtx) ;
|
||||||
return locked_getFileSharingPermissions(indx,flags,parent_groups) ;
|
return locked_getFileSharingPermissions(indx,flags,parent_groups) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocalDirectoryStorage::locked_getFileSharingPermissions(const EntryIndex& indx,FileStorageFlags& flags,std::list<std::string>& parent_groups)
|
bool LocalDirectoryStorage::locked_getFileSharingPermissions(const EntryIndex& indx, FileStorageFlags& flags, std::list<RsNodeGroupId> &parent_groups)
|
||||||
{
|
{
|
||||||
flags.clear() ;
|
flags.clear() ;
|
||||||
parent_groups.clear();
|
parent_groups.clear();
|
||||||
@ -1046,7 +1046,7 @@ bool LocalDirectoryStorage::locked_getFileSharingPermissions(const EntryIndex& i
|
|||||||
std::cerr << "(EE) very weird bug: base directory \"" << base_dir << "\" not found in shared dir list." << std::endl;
|
std::cerr << "(EE) very weird bug: base directory \"" << base_dir << "\" not found in shared dir list." << std::endl;
|
||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
#warning we should use a NodeGroupId here
|
|
||||||
flags = it->second.shareflags;
|
flags = it->second.shareflags;
|
||||||
parent_groups = it->second.parent_groups;
|
parent_groups = it->second.parent_groups;
|
||||||
}
|
}
|
||||||
@ -1069,7 +1069,7 @@ bool LocalDirectoryStorage::serialiseDirEntry(const EntryIndex& indx,RsTlvBinary
|
|||||||
// compute list of allowed subdirs
|
// compute list of allowed subdirs
|
||||||
std::vector<EntryIndex> allowed_subdirs ;
|
std::vector<EntryIndex> allowed_subdirs ;
|
||||||
FileStorageFlags node_flags ;
|
FileStorageFlags node_flags ;
|
||||||
std::list<std::string> node_groups ;
|
std::list<RsNodeGroupId> node_groups ;
|
||||||
|
|
||||||
// for each subdir, compute the node flags and groups, then ask rsPeers to compute the mask that result from these flags for the particular peer supplied in parameter
|
// for each subdir, compute the node flags and groups, then ask rsPeers to compute the mask that result from these flags for the particular peer supplied in parameter
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ public:
|
|||||||
* false if the index is not valid
|
* false if the index is not valid
|
||||||
* false otherwise
|
* false otherwise
|
||||||
*/
|
*/
|
||||||
bool getFileSharingPermissions(const EntryIndex& indx, FileStorageFlags &flags, std::list<std::string>& parent_groups);
|
bool getFileSharingPermissions(const EntryIndex& indx, FileStorageFlags &flags, std::list<RsNodeGroupId> &parent_groups);
|
||||||
|
|
||||||
virtual bool extractData(const EntryIndex& indx,DirDetails& d) ;
|
virtual bool extractData(const EntryIndex& indx,DirDetails& d) ;
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ public:
|
|||||||
bool serialiseDirEntry(const EntryIndex& indx, RsTlvBinaryData& bindata, const RsPeerId &client_id) ;
|
bool serialiseDirEntry(const EntryIndex& indx, RsTlvBinaryData& bindata, const RsPeerId &client_id) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool locked_getFileSharingPermissions(const EntryIndex& indx, FileStorageFlags &flags, std::list<std::string>& parent_groups);
|
bool locked_getFileSharingPermissions(const EntryIndex& indx, FileStorageFlags &flags, std::list<RsNodeGroupId>& parent_groups);
|
||||||
std::string locked_findRealRootFromVirtualFilename(const std::string& virtual_rootdir) const;
|
std::string locked_findRealRootFromVirtualFilename(const std::string& virtual_rootdir) const;
|
||||||
|
|
||||||
std::map<std::string,SharedDirInfo> mLocalDirs ; // map is better for search. it->first=it->second.filename
|
std::map<std::string,SharedDirInfo> mLocalDirs ; // map is better for search. it->first=it->second.filename
|
||||||
|
@ -756,7 +756,7 @@ void p3FileDatabase::handleDirSyncRequest(RsFileListsSyncRequestItem *item)
|
|||||||
ritem->request_id = item->request_id;
|
ritem->request_id = item->request_id;
|
||||||
ritem->entry_index = item->entry_index ;
|
ritem->entry_index = item->entry_index ;
|
||||||
|
|
||||||
std::list<std::string> node_groups;
|
std::list<RsNodeGroupId> node_groups;
|
||||||
FileStorageFlags node_flags;
|
FileStorageFlags node_flags;
|
||||||
|
|
||||||
if(entry_type != DIR_TYPE_DIR)
|
if(entry_type != DIR_TYPE_DIR)
|
||||||
|
@ -236,13 +236,13 @@ public:
|
|||||||
RsPeerId id;
|
RsPeerId id;
|
||||||
std::string name;
|
std::string name;
|
||||||
RsFileHash hash;
|
RsFileHash hash;
|
||||||
std::string path;
|
std::string path;
|
||||||
uint64_t count;
|
uint64_t count;
|
||||||
uint32_t age;
|
uint32_t age;
|
||||||
FileStorageFlags flags;
|
FileStorageFlags flags;
|
||||||
uint32_t min_age ; // minimum age of files in this subtree
|
uint32_t min_age ; // minimum age of files in this subtree
|
||||||
|
|
||||||
std::list<DirStub> children;
|
std::vector<DirStub> children;
|
||||||
std::list<RsNodeGroupId> parent_groups; // parent groups for the shared directory
|
std::list<RsNodeGroupId> parent_groups; // parent groups for the shared directory
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ std::ostream &operator<<(std::ostream &out, const DirDetails& d)
|
|||||||
std::cerr << " Age : " << d.age << std::endl;
|
std::cerr << " Age : " << d.age << std::endl;
|
||||||
std::cerr << " Min age : " << d.min_age << std::endl;
|
std::cerr << " Min age : " << d.min_age << std::endl;
|
||||||
std::cerr << " Flags : " << d.flags << std::endl;
|
std::cerr << " Flags : " << d.flags << std::endl;
|
||||||
std::cerr << " Parent groups : " ; for(std::list<std::string>::const_iterator it(d.parent_groups.begin());it!=d.parent_groups.end();++it) std::cerr << (*it) << " "; std::cerr << std::endl;
|
std::cerr << " Parent groups : " ; for(std::list<RsNodeGroupId>::const_iterator it(d.parent_groups.begin());it!=d.parent_groups.end();++it) std::cerr << (*it) << " "; std::cerr << std::endl;
|
||||||
std::cerr << " Children : " ; for(uint32_t i=0;i<d.children.size();++i) std::cerr << (void*)(intptr_t)d.children[i].ref << " "; std::cerr << std::endl;
|
std::cerr << " Children : " ; for(uint32_t i=0;i<d.children.size();++i) std::cerr << (void*)(intptr_t)d.children[i].ref << " "; std::cerr << std::endl;
|
||||||
std::cerr << "===================" << std::endl;
|
std::cerr << "===================" << std::endl;
|
||||||
return out;
|
return out;
|
||||||
|
Loading…
Reference in New Issue
Block a user