mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-25 09:11:06 -04:00
added methods to get files from hash(hash) in directory_storage and ftServer
This commit is contained in:
parent
2d72b88130
commit
0387a28e78
9 changed files with 122 additions and 44 deletions
|
@ -979,16 +979,20 @@ bool p3FileDatabase::search(const RsFileHash &hash, FileSearchFlags hintflags, F
|
|||
|
||||
if(hintflags & RS_FILE_HINTS_LOCAL)
|
||||
{
|
||||
std::list<EntryIndex> res;
|
||||
mLocalSharedDirs->searchHash(hash,res) ;
|
||||
RsFileHash real_hash ;
|
||||
EntryIndex indx;
|
||||
|
||||
if(res.empty())
|
||||
if(!mLocalSharedDirs->searchHash(hash,real_hash,indx))
|
||||
return false;
|
||||
|
||||
EntryIndex indx = *res.begin() ; // no need to report duplicates
|
||||
|
||||
mLocalSharedDirs->getFileInfo(indx,info) ;
|
||||
|
||||
if(!real_hash.isNull())
|
||||
{
|
||||
info.hash = real_hash ;
|
||||
info.transfer_info_flags |= RS_FILE_REQ_ENCRYPTED ;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue