mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
- Added flags for services and service permissions for peers
Flags are identity-related, meaning that all locations of the same peers have the same flags. - It's now possible to tweak which services each peer can use. Service that can be disabled are forums/channels, discovery, anonymous routing. - by default, peers have all flags on. - fixed missing error msg in p3cfgmgr when serialisation fails. - fixed bug in RemoteDirModel causing infinite loop to happen when group name is unknown git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5924 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
099a3ad33e
commit
e3da77612a
24 changed files with 887 additions and 242 deletions
|
@ -749,7 +749,7 @@ int p3turtle::handleIncoming()
|
|||
{
|
||||
nhandled++;
|
||||
|
||||
if(!(_turtle_routing_enabled && _turtle_routing_session_enabled))
|
||||
if( (!(_turtle_routing_enabled && _turtle_routing_session_enabled)) || !(RS_SERVICE_PERM_TURTLE & rsPeers->servicePermissionFlags_sslid(item->PeerId())))
|
||||
delete item ;
|
||||
else
|
||||
{
|
||||
|
@ -903,6 +903,9 @@ void p3turtle::handleSearchRequest(RsTurtleSearchRequestItem *item)
|
|||
|
||||
for(std::list<std::string>::const_iterator it(onlineIds.begin());it!=onlineIds.end();++it)
|
||||
{
|
||||
if(!(RS_SERVICE_PERM_TURTLE & rsPeers->servicePermissionFlags_sslid(*it)))
|
||||
continue ;
|
||||
|
||||
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)!
|
||||
|
@ -1956,6 +1959,15 @@ void p3turtle::handleTunnelRequest(RsTurtleOpenTunnelItem *item)
|
|||
std::list<std::string> onlineIds ;
|
||||
mLinkMgr->getOnlineList(onlineIds);
|
||||
|
||||
for(std::list<std::string>::iterator it(onlineIds.begin());it!=onlineIds.end();)
|
||||
if(!(RS_SERVICE_PERM_TURTLE & rsPeers->servicePermissionFlags_sslid(*it)))
|
||||
{
|
||||
std::list<std::string>::iterator tmp = it++ ;
|
||||
onlineIds.erase(tmp) ;
|
||||
}
|
||||
else
|
||||
++it ;
|
||||
|
||||
int nb_online_ids = onlineIds.size() ;
|
||||
|
||||
if(forward_probability * nb_online_ids < 1.0f && nb_online_ids > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue