fixed bug with anonymous channels asking for friends to be sources

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4632 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-10-06 20:06:25 +00:00
parent 6addc80e99
commit 2173ee0d2e
2 changed files with 19 additions and 18 deletions

View File

@ -1176,7 +1176,7 @@ bool ftController::FileRequest(const std::string& fname, const std::string& has
/* do a source search - for any extra sources */ /* do a source search - for any extra sources */
// add sources only in direct mode // add sources only in direct mode
// //
if ((!(flags & RS_FILE_HINTS_NETWORK_WIDE)) && mSearch->search(hash, RS_FILE_HINTS_REMOTE | RS_FILE_HINTS_SPEC_ONLY, info)) if((flags & RS_FILE_HINTS_BROWSABLE) && mSearch->search(hash, RS_FILE_HINTS_REMOTE | RS_FILE_HINTS_SPEC_ONLY, info))
{ {
/* do something with results */ /* do something with results */
#ifdef CONTROL_DEBUG #ifdef CONTROL_DEBUG

View File

@ -827,8 +827,7 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, con
/* Iterate through files */ /* Iterate through files */
std::list<RsTlvFileItem>::iterator fit; std::list<RsTlvFileItem>::iterator fit;
for(fit = chanMsg->attachment.items.begin(); for(fit = chanMsg->attachment.items.begin(); fit != chanMsg->attachment.items.end(); fit++)
fit != chanMsg->attachment.items.end(); fit++)
{ {
std::string fname = fit->name; std::string fname = fit->name;
std::string hash = fit->hash; std::string hash = fit->hash;
@ -839,20 +838,23 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, con
uint32_t flags; uint32_t flags;
// send to download directory if file is private // send to download directory if file is private
if(chanPrivate){ // We also add explicit sources only if the channel is private. Otherwise we DL in network wide mode
localpath = mChannelsDir; // using anonymous tunnels.
flags = RS_FILE_HINTS_BACKGROUND | RS_FILE_HINTS_EXTRA; //
}else{
localpath = ""; // forces dl to default directory
flags = RS_FILE_HINTS_BACKGROUND |
RS_FILE_HINTS_NETWORK_WIDE;
}
std::list<std::string> srcIds; std::list<std::string> srcIds;
srcIds.push_back(id);
if(chanPrivate)
{
localpath = mChannelsDir;
flags = RS_FILE_HINTS_BACKGROUND | RS_FILE_HINTS_EXTRA;
srcIds.push_back(id);
}
else
{
localpath = ""; // forces dl to default directory
flags = RS_FILE_HINTS_BACKGROUND | RS_FILE_HINTS_NETWORK_WIDE;
}
/* download it ... and flag for ExtraList /* download it ... and flag for ExtraList
* don't do pre-search check as FileRequest does it better * don't do pre-search check as FileRequest does it better
@ -866,8 +868,7 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, con
#endif #endif
if(size < MAX_AUTO_DL) if(size < MAX_AUTO_DL)
mRsFiles->FileRequest(fname, hash, size, mRsFiles->FileRequest(fname, hash, size, localpath, flags, srcIds);
localpath, flags, srcIds);
} }
if(lit != mReadStatus.end()){ if(lit != mReadStatus.end()){