mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
change to only one ip list instead of one local and one remote
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1807 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9a6ff52da1
commit
f85adf7c25
6 changed files with 25 additions and 37 deletions
|
@ -764,7 +764,7 @@ uint32_t RsPeerConfigSerialiser::sizeNet(RsPeerNetItem *i)
|
|||
s += GetTlvIpAddrPortV4Size(); /* remoteaddr */
|
||||
|
||||
//add the size of the ip list
|
||||
int ipListSize = i->remoteaddrList.size();
|
||||
int ipListSize = i->ipAddressList.size();
|
||||
s += ipListSize * GetTlvIpAddrPortV4Size();
|
||||
s += ipListSize * 8; //size of an uint64
|
||||
|
||||
|
@ -806,7 +806,7 @@ bool RsPeerConfigSerialiser::serialiseNet(RsPeerNetItem *item, void *data, uint3
|
|||
|
||||
//store the ip list
|
||||
std::list<IpAddressTimed>::iterator ipListIt;
|
||||
for (ipListIt = item->remoteaddrList.begin(); ipListIt!=(item->remoteaddrList.end()); ipListIt++) {
|
||||
for (ipListIt = item->ipAddressList.begin(); ipListIt!=(item->ipAddressList.end()); ipListIt++) {
|
||||
ok &= SetTlvIpAddrPortV4(data, tlvsize, &offset, TLV_TYPE_IPV4_REMOTE, &(ipListIt->ipAddr));
|
||||
ok &= setRawUInt64(data, tlvsize, &offset, ipListIt->seenTime);
|
||||
}
|
||||
|
@ -872,7 +872,7 @@ RsPeerNetItem *RsPeerConfigSerialiser::deserialiseNet(void *data, uint32_t *size
|
|||
ipTimed.seenTime = time;
|
||||
ipTimedList.push_back(ipTimed);
|
||||
}
|
||||
item->remoteaddrList = ipTimedList;
|
||||
item->ipAddressList = ipTimedList;
|
||||
|
||||
if (offset != rssize)
|
||||
{
|
||||
|
|
|
@ -76,8 +76,7 @@ std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
|||
struct sockaddr_in currentlocaladdr; /* Mandatory */
|
||||
struct sockaddr_in currentremoteaddr; /* Mandatory */
|
||||
|
||||
std::list<IpAddressTimed> localaddrList;
|
||||
std::list<IpAddressTimed> remoteaddrList;
|
||||
std::list<IpAddressTimed> ipAddressList;
|
||||
};
|
||||
|
||||
class RsPeerStunItem: public RsItem
|
||||
|
|
|
@ -82,8 +82,7 @@ virtual void clear();
|
|||
virtual std::ostream &print(std::ostream &out, uint16_t indent = 0);
|
||||
|
||||
//use for transmitting peer adress list
|
||||
std::list<IpAddressTimed> localaddrList;
|
||||
std::list<IpAddressTimed> remoteaddrList;
|
||||
std::list<IpAddressTimed> ipAddressList;
|
||||
|
||||
//use for transmitting my own adress list
|
||||
struct sockaddr_in currentladdr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue