mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-18 11:29:31 -04:00
disabled turtle routing for relayed connexions
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4799 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
66f6c08f33
commit
2805d4ca1e
1 changed files with 15 additions and 0 deletions
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
#include "pqi/authssl.h"
|
#include "pqi/authssl.h"
|
||||||
#include "pqi/p3linkmgr.h"
|
#include "pqi/p3linkmgr.h"
|
||||||
|
#include "retroshare/rspeers.h"
|
||||||
#include "pqi/pqinotify.h"
|
#include "pqi/pqinotify.h"
|
||||||
|
|
||||||
#include "ft/ftserver.h"
|
#include "ft/ftserver.h"
|
||||||
|
@ -807,6 +808,12 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(std::list<std::string>::const_iterator it(onlineIds.begin());it!=onlineIds.end();++it)
|
for(std::list<std::string>::const_iterator it(onlineIds.begin());it!=onlineIds.end();++it)
|
||||||
|
{
|
||||||
|
uint32_t linkType = mLinkMgr->getLinkType(*it);
|
||||||
|
|
||||||
|
if ((linkType & RS_NET_CONN_SPEED_TRICKLE) || (linkType & RS_NET_CONN_SPEED_LOW)) // don't forward searches to slow link types (e.g relay peers)!
|
||||||
|
continue ;
|
||||||
|
|
||||||
if(*it != item->PeerId())
|
if(*it != item->PeerId())
|
||||||
{
|
{
|
||||||
#ifdef P3TURTLE_DEBUG
|
#ifdef P3TURTLE_DEBUG
|
||||||
|
@ -828,6 +835,7 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item)
|
||||||
|
|
||||||
sendItem(fwd_item) ;
|
sendItem(fwd_item) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef P3TURTLE_DEBUG
|
#ifdef P3TURTLE_DEBUG
|
||||||
else
|
else
|
||||||
|
@ -1732,6 +1740,12 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(std::list<std::string>::const_iterator it(onlineIds.begin());it!=onlineIds.end();++it)
|
for(std::list<std::string>::const_iterator it(onlineIds.begin());it!=onlineIds.end();++it)
|
||||||
|
{
|
||||||
|
uint32_t linkType = mLinkMgr->getLinkType(*it);
|
||||||
|
|
||||||
|
if ((linkType & RS_NET_CONN_SPEED_TRICKLE) || (linkType & RS_NET_CONN_SPEED_LOW)) // don't forward tunnel requests to slow link types (e.g relay peers)!
|
||||||
|
continue ;
|
||||||
|
|
||||||
if(*it != item->PeerId() && RSRandom::random_f32() <= forward_probability)
|
if(*it != item->PeerId() && RSRandom::random_f32() <= forward_probability)
|
||||||
{
|
{
|
||||||
#ifdef P3TURTLE_DEBUG
|
#ifdef P3TURTLE_DEBUG
|
||||||
|
@ -1758,6 +1772,7 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item)
|
||||||
|
|
||||||
sendItem(fwd_item) ;
|
sendItem(fwd_item) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef P3TURTLE_DEBUG
|
#ifdef P3TURTLE_DEBUG
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue