mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 21:04:32 -04:00
Added a seperation between 'desired' net mode and 'actual' net mode
this is needed for accurate stunlist creation. Also added stunStatus calls from discovery. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@355 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
685182ff0b
commit
06cb9e0121
9 changed files with 144 additions and 27 deletions
|
@ -334,7 +334,7 @@ void p3disc::sendOwnDetails(std::string to)
|
|||
di->discFlags |= P3DISC_FLAGS_USE_DHT;
|
||||
}
|
||||
|
||||
if ((detail.netMode == RS_NET_MODE_EXT) ||
|
||||
if ((detail.netMode & RS_NET_MODE_EXT) ||
|
||||
(detail.netMode & RS_NET_MODE_UPNP))
|
||||
{
|
||||
di->discFlags |= P3DISC_FLAGS_EXTERNAL_ADDR;
|
||||
|
@ -408,7 +408,7 @@ void p3disc::sendPeerDetails(std::string to, std::string about)
|
|||
di->discFlags |= P3DISC_FLAGS_USE_DHT;
|
||||
}
|
||||
|
||||
if (detail.netMode == RS_NET_MODE_EXT)
|
||||
if (detail.netMode & RS_NET_MODE_EXT)
|
||||
{
|
||||
di->discFlags |= P3DISC_FLAGS_EXTERNAL_ADDR;
|
||||
}
|
||||
|
@ -483,6 +483,10 @@ void p3disc::recvPeerOwnMsg(RsDiscItem *item)
|
|||
mConnMgr->peerStatus(item->PeerId(), item->laddr, item->saddr,
|
||||
type, flags, RS_CB_PERSON);
|
||||
|
||||
/* also add as potential stun buddy */
|
||||
mConnMgr->stunStatus(item->PeerId(), item->saddr, type,
|
||||
RS_STUN_ONLINE | RS_STUN_FRIEND);
|
||||
|
||||
/* now reply with all details */
|
||||
respondToPeer(item->PeerId());
|
||||
|
||||
|
@ -540,6 +544,10 @@ void p3disc::recvPeerFriendMsg(RsDiscReply *item)
|
|||
{
|
||||
mConnMgr->peerStatus(peerId, item->laddr,
|
||||
item->saddr, type, flags, RS_CB_DISC);
|
||||
|
||||
mConnMgr->stunStatus(peerId, item->saddr, type,
|
||||
RS_STUN_FRIEND_OF_FRIEND);
|
||||
|
||||
}
|
||||
|
||||
addDiscoveryData(item->PeerId(), peerId, item->laddr, item->saddr, item->discFlags, time(NULL));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue