mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 12:24:24 -04:00
Rewrite of the discovery system to be more private, with less traffic.
Split the visState into seperate vs_disc and vs_dht for easier handling. Split the heartbeat system into a separate service. Added IPv4 and IPv6 local/ext addresses into discovery & peer config. Fixed up samenet and samesubnet ipv4 calls. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6773 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
70c947ba90
commit
90aa57a0f0
38 changed files with 3248 additions and 1543 deletions
|
@ -140,8 +140,10 @@ p3NetMgrIMPL::p3NetMgrIMPL()
|
|||
mLocalAddr.ss_family = AF_INET;
|
||||
mExtAddr.ss_family = AF_INET;
|
||||
|
||||
// default to full.
|
||||
mVsDisc = RS_VS_DISC_FULL;
|
||||
mVsDht = RS_VS_DHT_FULL;
|
||||
|
||||
mVisState = 0 ;
|
||||
}
|
||||
|
||||
#ifdef NETMGR_DEBUG
|
||||
|
@ -570,10 +572,10 @@ void p3NetMgrIMPL::netDhtInit()
|
|||
uint32_t vs = 0;
|
||||
{
|
||||
RsStackMutex stack(mNetMtx); /*********** LOCKED MUTEX ************/
|
||||
vs = mVisState;
|
||||
vs = mVsDht;
|
||||
}
|
||||
|
||||
enableNetAssistConnect(!(vs & RS_VIS_STATE_NODHT));
|
||||
enableNetAssistConnect(vs != RS_VS_DHT_OFF);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1167,15 +1169,16 @@ bool p3NetMgrIMPL::setNetworkMode(uint32_t netMode)
|
|||
}
|
||||
|
||||
|
||||
bool p3NetMgrIMPL::setVisState(uint32_t visState)
|
||||
bool p3NetMgrIMPL::setVisState(uint16_t vs_disc, uint16_t vs_dht)
|
||||
{
|
||||
RsStackMutex stack(mNetMtx); /****** STACK LOCK MUTEX *******/
|
||||
mVisState = visState;
|
||||
mVsDisc = vs_disc;
|
||||
mVsDht = vs_dht;
|
||||
|
||||
/* if we've started up - then tweak Dht On/Off */
|
||||
if (mNetStatus != RS_NET_UNKNOWN)
|
||||
{
|
||||
enableNetAssistConnect(!(mVisState & RS_VIS_STATE_NODHT));
|
||||
enableNetAssistConnect(mVsDht != RS_VS_DHT_OFF);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue