mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-08 06:12:43 -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.
|
// 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
|
#ifdef P3DISC_DEBUG
|
||||||
std::cerr << "Friend is not connected -> updating info" << std::endl;
|
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
|
// Update if it's fresh info or if it's from the peer itself
|
||||||
// their info is fresher than ours, update ours
|
// their info is fresher than ours, update ours
|
||||||
//
|
//
|
||||||
mConnMgr->setNetworkMode(pitem->pid, pitem->netMode);
|
if(!(storedDetails.state & RS_PEER_CONNECTED))
|
||||||
mConnMgr->setLocation(pitem->pid, pitem->location);
|
{
|
||||||
|
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,
|
// The info from the peer itself is ultimately trustable, so we can override some info,
|
||||||
// such as:
|
// such as:
|
||||||
// - local and global addresses
|
// - local and global addresses
|
||||||
// - address list
|
// - address list
|
||||||
//
|
//
|
||||||
|
// If we enter here, we're necessarily connected to this peer.
|
||||||
|
//
|
||||||
if (item->PeerId() == pitem->pid)
|
if (item->PeerId() == pitem->pid)
|
||||||
{
|
{
|
||||||
#ifdef P3DISC_DEBUG
|
#ifdef P3DISC_DEBUG
|
||||||
|
@ -590,8 +595,8 @@ void p3disc::recvPeerDetails(RsDiscReply *item)
|
||||||
std::cerr << " -> current remote addr = " << pitem->currentremoteaddr << std::endl;
|
std::cerr << " -> current remote addr = " << pitem->currentremoteaddr << std::endl;
|
||||||
std::cerr << " -> clearing NODISC flag " << std::endl;
|
std::cerr << " -> clearing NODISC flag " << std::endl;
|
||||||
#endif
|
#endif
|
||||||
mConnMgr->setLocalAddress(pitem->pid, pitem->currentlocaladdr);
|
//mConnMgr->setLocalAddress(pitem->pid, pitem->currentlocaladdr);
|
||||||
mConnMgr->setExtAddress(pitem->pid, pitem->currentremoteaddr);
|
//mConnMgr->setExtAddress(pitem->pid, pitem->currentremoteaddr);
|
||||||
pitem->visState &= ~RS_VIS_STATE_NODISC ;
|
pitem->visState &= ~RS_VIS_STATE_NODISC ;
|
||||||
mConnMgr->setVisState(pitem->pid, pitem->visState);
|
mConnMgr->setVisState(pitem->pid, pitem->visState);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue