From a83345e394ce56476219d3d199a32bc8684256d7 Mon Sep 17 00:00:00 2001 From: joss17 Date: Sun, 20 Dec 2009 13:26:23 +0000 Subject: [PATCH] still trying to fix this list serial ip address git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1919 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3disc.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/services/p3disc.cc b/libretroshare/src/services/p3disc.cc index 106118a79..ad4513478 100644 --- a/libretroshare/src/services/p3disc.cc +++ b/libretroshare/src/services/p3disc.cc @@ -366,9 +366,15 @@ void p3disc::sendOwnDetails(std::string to) std::cerr << "p3disc::sendOwnDetails() detail.currentlocaladdr.sin_addr : " << inet_ntoa(detail.currentlocaladdr.sin_addr) << ":" << ntohs(detail.currentlocaladdr.sin_port) << std::endl; std::cerr << "p3disc::sendOwnDetails() detail.currentserveraddr.sin_addr : " << inet_ntoa(detail.currentserveraddr.sin_addr) << ":" << ntohs(detail.currentlocaladdr.sin_port) << std::endl; #endif + di -> ipAddressList.clear(); + for ( std::list::iterator ipListIt = detail.getIpAddressList().begin(); ipListIt!= detail.getIpAddressList().end(); ipListIt++) { + IpAddressTimed ipAddress; + ipAddress.ipAddr = ipListIt->ipAddr; + ipAddress.seenTime = ipListIt->seenTime; + di -> ipAddressList.push_back(ipAddress); + } - di -> ipAddressList = std::list (detail.getIpAddressList()); //duplicate the list to build the item - di -> contact_tf = 0; + di -> contact_tf = 0; /* construct disc flags */ di -> discFlags = 0; @@ -442,9 +448,15 @@ void p3disc::sendPeerDetails(std::string to, std::string about) di -> PeerId(to); di -> aboutId = about; - // set the ip addresses. - di -> ipAddressList = std::list (detail.getIpAddressList()); //duplicate the list to build the item - di -> currentladdr = detail.currentlocaladdr; + // set the ip addresse list. + di -> ipAddressList.clear(); + for ( std::list::iterator ipListIt = detail.getIpAddressList().begin(); ipListIt!= detail.getIpAddressList().end(); ipListIt++) { + IpAddressTimed ipAddress; + ipAddress.ipAddr = ipListIt->ipAddr; + ipAddress.seenTime = ipListIt->seenTime; + di -> ipAddressList.push_back(ipAddress); + } + di -> currentladdr = detail.currentlocaladdr; di -> currentsaddr = detail.currentserveraddr; if (detail.state & RS_PEER_S_CONNECTED)