mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05:00
add direct public sources for files shared in channels, when available
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5591 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0cb0a9b0f9
commit
16f07f766c
@ -595,26 +595,24 @@ void SubFileItem::download()
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
if (mType == SFI_TYPE_CHANNEL)
|
||||
{
|
||||
/* send request via rsChannels -> as it knows how to do it properly */
|
||||
//std::string grpId = mSrcId;
|
||||
//rsChannels->FileRequest(mFileName, mFileHash, mFileSize, grpId);
|
||||
}
|
||||
else
|
||||
{
|
||||
//rsFile->FileRequest(mFileName, mFileHash, mFileSize, "", 0, mSrcId);
|
||||
}
|
||||
std::list<std::string> sources ;
|
||||
|
||||
// Add possible direct sources.
|
||||
//
|
||||
FileInfo finfo ;
|
||||
rsFiles->FileDetails(mFileHash,RS_FILE_HINTS_REMOTE,finfo) ;
|
||||
|
||||
for(std::list<TransferInfo>::const_iterator it(finfo.peers.begin());it!=finfo.peers.end();++it)
|
||||
sources.push_back((*it).peerId) ;
|
||||
|
||||
// TEMP
|
||||
std::cerr << "SubFileItem::download() Calling File Request";
|
||||
std::cerr << std::endl;
|
||||
std::list<std::string> srcIds;
|
||||
|
||||
if (mSrcId != "")
|
||||
{
|
||||
srcIds.push_back(mSrcId);
|
||||
}
|
||||
rsFiles->FileRequest(mFileName, mFileHash, mFileSize, "", RS_FILE_HINTS_NETWORK_WIDE, srcIds);
|
||||
sources.push_back(mSrcId);
|
||||
|
||||
rsFiles->FileRequest(mFileName, mFileHash, mFileSize, "", RS_FILE_HINTS_NETWORK_WIDE, sources);
|
||||
|
||||
downloadButton->setEnabled(false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user