From cc6b480156258ff69c11df63149447f497f5626f Mon Sep 17 00:00:00 2001 From: joss17 Date: Fri, 18 Dec 2009 23:35:25 +0000 Subject: [PATCH] improve address list config serialization git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1916 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3connmgr.cc | 8 +++----- libretroshare/src/serialiser/rsconfigitems.cc | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index 99df68cbd..4daaf685f 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -2891,8 +2891,6 @@ bool p3ConnectMgr::loadList(std::list load) #endif /* add ownConfig */ setOwnNetConfig(pitem->netMode, pitem->visState); - setLocalAddress(pitem->pid, pitem->currentlocaladdr); - setExtAddress(pitem->pid, pitem->currentremoteaddr); } else { @@ -2903,10 +2901,10 @@ bool p3ConnectMgr::loadList(std::list load) #endif /* ************* */ addFriend(pitem->pid, pitem->netMode, pitem->visState, pitem->lastContact); - setLocalAddress(pitem->pid, pitem->currentlocaladdr); - setExtAddress(pitem->pid, pitem->currentremoteaddr); - setAddressList(pitem->pid, pitem->ipAddressList); } + setLocalAddress(pitem->pid, pitem->currentlocaladdr); + setExtAddress(pitem->pid, pitem->currentremoteaddr); + setAddressList(pitem->pid, pitem->ipAddressList); } else if (sitem) { diff --git a/libretroshare/src/serialiser/rsconfigitems.cc b/libretroshare/src/serialiser/rsconfigitems.cc index ba8621d47..496df33ed 100644 --- a/libretroshare/src/serialiser/rsconfigitems.cc +++ b/libretroshare/src/serialiser/rsconfigitems.cc @@ -889,11 +889,10 @@ RsPeerNetItem *RsPeerConfigSerialiser::deserialiseNet(void *data, uint32_t *size IpAddressTimed ipTimed; sockaddr_clear(&ipTimed.ipAddr); ok &= GetTlvIpAddrPortV4(data, rssize, &offset, TLV_TYPE_IPV4_REMOTE, &ipTimed.ipAddr); + if (!ok) { break;} uint64_t time = 0; ok &= getRawUInt64(data, rssize, &offset, &time); - if (!ok) { - break; - } + if (!ok) { break;} ipTimed.seenTime = time; ipTimedList.push_back(ipTimed); }