From 83db3bebb9c7319a48fd72975c04e43838096ccf Mon Sep 17 00:00:00 2001 From: joss17 Date: Tue, 15 Dec 2009 17:48:48 +0000 Subject: [PATCH] add current local and external address to ip list git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1890 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3connmgr.cc | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index c4bfcf617..9ea728cfa 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -1735,10 +1735,21 @@ void p3ConnectMgr::peerStatus(std::string id, it->second.source = RS_CB_DISC; it->second.disc = details; - it->second.currentlocaladdr = laddr; - it->second.currentserveraddr = raddr; it->second.updateIpAddressList(ipDiscAddressList); + it->second.currentlocaladdr = laddr; + it->second.currentserveraddr = raddr; + //add the given address to the address list + IpAddressTimed laddrTimed; + laddrTimed.ipAddr = laddr; + laddrTimed.seenTime = time(NULL); + it->second.updateIpAddressList(laddrTimed); + + IpAddressTimed raddrTimed; + raddrTimed.ipAddr = raddr; + raddrTimed.seenTime = time(NULL); + it->second.updateIpAddressList(raddrTimed); + if (flags & RS_NET_FLAGS_ONLINE) { it->second.actions |= RS_PEER_ONLINE; @@ -1761,10 +1772,21 @@ void p3ConnectMgr::peerStatus(std::string id, it->second.source = RS_CB_PERSON; it->second.peer = details; - it->second.currentlocaladdr = laddr; - it->second.currentserveraddr = raddr; it->second.updateIpAddressList(ipDiscAddressList); + it->second.currentlocaladdr = laddr; + it->second.currentserveraddr = raddr; + //add the given address to the address list + IpAddressTimed laddrTimed; + laddrTimed.ipAddr = laddr; + laddrTimed.seenTime = time(NULL); + it->second.updateIpAddressList(laddrTimed); + + IpAddressTimed raddrTimed; + raddrTimed.ipAddr = raddr; + raddrTimed.seenTime = time(NULL); + it->second.updateIpAddressList(raddrTimed); + it->second.state |= RS_PEER_S_ONLINE; it->second.lastavailable = now;