fixed non working tunneling system, due to wrong service id used to query online peers

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7283 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-04-19 15:52:06 +00:00
parent 0c224b014d
commit 11e370c56d
2 changed files with 8 additions and 3 deletions

View File

@ -125,6 +125,7 @@ p3turtle::p3turtle(p3ServiceControl *sc,p3LinkMgr *lm)
_traffic_info.reset() ;
_max_tr_up_rate = MAX_TR_FORWARD_PER_SEC ;
_service_type = getServiceInfo().mServiceType ;
}
const std::string TURTLE_APP_NAME = "turtle";
@ -919,7 +920,7 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item)
if(item->depth < TURTLE_MAX_SEARCH_DEPTH || random_bypass)
{
std::set<RsPeerId> onlineIds ;
mServiceControl->getPeersConnected(RS_SERVICE_TYPE_TURTLE, onlineIds);
mServiceControl->getPeersConnected(_service_type, onlineIds);
#ifdef P3TURTLE_DEBUG
std::cerr << " Looking for online peers" << std::endl ;
#endif
@ -1482,7 +1483,7 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item)
if(item->depth < TURTLE_MAX_SEARCH_DEPTH || random_bypass)
{
std::set<RsPeerId> onlineIds ;
mServiceControl->getPeersConnected(RS_SERVICE_TYPE_TURTLE, onlineIds);
mServiceControl->getPeersConnected(_service_type, onlineIds);
// for(std::set<RsPeerId>::iterator it(onlineIds.begin());it!=onlineIds.end();)
// if(!mServiceControl->isPeerConnected(RS_SERVICE_PERM_TURTLE,*it))
@ -1948,7 +1949,7 @@ void p3turtle::getTrafficStatistics(TurtleTrafficStatisticsInfo& info) const
info.forward_probabilities.clear() ;
std::set<RsPeerId> onlineIds ;
mServiceControl->getPeersConnected(RS_SERVICE_TYPE_TURTLE, onlineIds);
mServiceControl->getPeersConnected(_service_type, onlineIds);
int nb_online_ids = onlineIds.size() ;

View File

@ -430,6 +430,10 @@ class p3turtle: public p3Service, public RsTurtle, public p3Config
bool _turtle_routing_enabled ;
bool _turtle_routing_session_enabled ;
// p3ServiceControl service type
uint32_t _service_type ;
#ifdef P3TURTLE_DEBUG
// debug function
void dumpState() ;