corrected bug that would allow a direct friend to DL a file that is NETWORK_WIDE only, using direct transfer

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4648 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-10-21 22:25:18 +00:00
parent 303f6333f6
commit c8ea41a4db

View File

@ -34,6 +34,7 @@
#include "ft/ftfilecreator.h" #include "ft/ftfilecreator.h"
#include "ft/ftfileprovider.h" #include "ft/ftfileprovider.h"
#include "ft/ftsearch.h" #include "ft/ftsearch.h"
#include <retroshare/rsturtle.h>
/* For Thread Behaviour */ /* For Thread Behaviour */
const uint32_t DMULTIPLEX_MIN = 10; /* 1ms sleep */ const uint32_t DMULTIPLEX_MIN = 10; /* 1ms sleep */
@ -790,26 +791,6 @@ bool ftDataMultiplex::handleSearchRequest(const std::string& peerId, const std::
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
// {
// RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
//
// /* Check for bad requests */
// std::map<std::string, time_t>::iterator bit;
// if (mUnknownHashs.end() != (bit = mUnknownHashs.find(hash)))
// {
//
//#ifdef MPLEX_DEBUG
// std::cerr << "ftDataMultiplex::handleSearchRequest(";
// std::cerr << " Found Ignore Hash ... done";
// std::cerr << std::endl;
//#endif
//
// /* We've previously rejected this one, so ignore */
// return false;
// }
// }
/* /*
* Do Actual search * Do Actual search
* Could be Cache File, Local or Extra * Could be Cache File, Local or Extra
@ -822,12 +803,12 @@ bool ftDataMultiplex::handleSearchRequest(const std::string& peerId, const std::
*/ */
FileInfo info; FileInfo info;
uint32_t hintflags = ( RS_FILE_HINTS_NETWORK_WIDE uint32_t hintflags = RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SPEC_ONLY ;
| RS_FILE_HINTS_BROWSABLE
| RS_FILE_HINTS_CACHE if(rsTurtle->isTurtlePeer(peerId))
| RS_FILE_HINTS_EXTRA hintflags |= RS_FILE_HINTS_NETWORK_WIDE ;
| RS_FILE_HINTS_LOCAL else
| RS_FILE_HINTS_SPEC_ONLY); hintflags |= RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_CACHE ;
if (mSearch->search(hash, hintflags, info)) if (mSearch->search(hash, hintflags, info))
{ {