mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-08 15:29:35 -04:00
corrected missed update of peer info when connected. Disabled setting peer connexion IP from p3disc info (does not make sense, and leads to errors)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@3151 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9bac4ea41f
commit
1892a87ceb
1 changed files with 10 additions and 5 deletions
|
@ -564,7 +564,7 @@ void p3disc::recvPeerDetails(RsDiscReply *item)
|
|||
|
||||
// Update if know this peer, and if it's not already connected.
|
||||
//
|
||||
if(rsPeers->getPeerDetails(pitem->pid, storedDetails) && !(storedDetails.state & RS_PEER_CONNECTED))
|
||||
if(rsPeers->getPeerDetails(pitem->pid, storedDetails))
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
std::cerr << "Friend is not connected -> updating info" << std::endl;
|
||||
|
@ -574,14 +574,19 @@ void p3disc::recvPeerDetails(RsDiscReply *item)
|
|||
// Update if it's fresh info or if it's from the peer itself
|
||||
// their info is fresher than ours, update ours
|
||||
//
|
||||
mConnMgr->setNetworkMode(pitem->pid, pitem->netMode);
|
||||
mConnMgr->setLocation(pitem->pid, pitem->location);
|
||||
if(!(storedDetails.state & RS_PEER_CONNECTED))
|
||||
{
|
||||
mConnMgr->setNetworkMode(pitem->pid, pitem->netMode);
|
||||
mConnMgr->setLocation(pitem->pid, pitem->location);
|
||||
}
|
||||
|
||||
// The info from the peer itself is ultimately trustable, so we can override some info,
|
||||
// such as:
|
||||
// - local and global addresses
|
||||
// - address list
|
||||
//
|
||||
// If we enter here, we're necessarily connected to this peer.
|
||||
//
|
||||
if (item->PeerId() == pitem->pid)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
|
@ -590,8 +595,8 @@ void p3disc::recvPeerDetails(RsDiscReply *item)
|
|||
std::cerr << " -> current remote addr = " << pitem->currentremoteaddr << std::endl;
|
||||
std::cerr << " -> clearing NODISC flag " << std::endl;
|
||||
#endif
|
||||
mConnMgr->setLocalAddress(pitem->pid, pitem->currentlocaladdr);
|
||||
mConnMgr->setExtAddress(pitem->pid, pitem->currentremoteaddr);
|
||||
//mConnMgr->setLocalAddress(pitem->pid, pitem->currentlocaladdr);
|
||||
//mConnMgr->setExtAddress(pitem->pid, pitem->currentremoteaddr);
|
||||
pitem->visState &= ~RS_VIS_STATE_NODISC ;
|
||||
mConnMgr->setVisState(pitem->pid, pitem->visState);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue