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:
csoler 2012-09-23 20:02:07 +00:00
parent 0cb0a9b0f9
commit 16f07f766c

View File

@ -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);