mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-25 09:11:06 -04:00
added missing code for remote search by hash, fixing the bug of direct sources not added
This commit is contained in:
parent
8d146038c2
commit
160ab7b4f3
4 changed files with 39 additions and 7 deletions
|
@ -1089,7 +1089,23 @@ bool p3FileDatabase::search(const RsFileHash &hash, FileSearchFlags hintflags, F
|
|||
|
||||
if(hintflags & RS_FILE_HINTS_REMOTE)
|
||||
{
|
||||
NOT_IMPLEMENTED();
|
||||
EntryIndex indx;
|
||||
bool found = false ;
|
||||
|
||||
for(uint32_t i=0;i<mRemoteDirectories.size();++i)
|
||||
if(mRemoteDirectories[i] != NULL && mRemoteDirectories[i]->searchHash(hash,indx))
|
||||
{
|
||||
TransferInfo ti ;
|
||||
ti.peerId = mRemoteDirectories[i]->peerId();
|
||||
|
||||
info.hash = hash ;
|
||||
info.peers.push_back(ti) ;
|
||||
|
||||
found = true ;
|
||||
}
|
||||
|
||||
if(found)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue