From 22bf9b11b11403e6a650e8e4ea028aa15624114c Mon Sep 17 00:00:00 2001 From: joss17 Date: Sun, 20 Dec 2009 13:26:44 +0000 Subject: [PATCH] fix infinite loop git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1920 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3disc.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/services/p3disc.cc b/libretroshare/src/services/p3disc.cc index ad4513478..9b95c3ce3 100644 --- a/libretroshare/src/services/p3disc.cc +++ b/libretroshare/src/services/p3disc.cc @@ -367,8 +367,9 @@ void p3disc::sendOwnDetails(std::string to) 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; + std::list ipAddressListTemp = detail.getIpAddressList(); + for ( std::list::iterator ipListIt = ipAddressListTemp.begin(); ipListIt!= ipAddressListTemp.end(); ipListIt++) { + IpAddressTimed ipAddress; ipAddress.ipAddr = ipListIt->ipAddr; ipAddress.seenTime = ipListIt->seenTime; di -> ipAddressList.push_back(ipAddress); @@ -450,7 +451,8 @@ void p3disc::sendPeerDetails(std::string to, std::string about) // set the ip addresse list. di -> ipAddressList.clear(); - for ( std::list::iterator ipListIt = detail.getIpAddressList().begin(); ipListIt!= detail.getIpAddressList().end(); ipListIt++) { + std::list ipAddressListTemp = detail.getIpAddressList(); + for ( std::list::iterator ipListIt = ipAddressListTemp.begin(); ipListIt!= ipAddressListTemp.end(); ipListIt++) { IpAddressTimed ipAddress; ipAddress.ipAddr = ipListIt->ipAddr; ipAddress.seenTime = ipListIt->seenTime;