Networking REWORK: Changes for other bits

* Fixed #includes in upnp
 * switched p3disc over to the new data types.
 * added new source to .pro file
 * minor changes to other code.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3249 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2010-07-04 10:42:17 +00:00
parent 8745c2fe2e
commit ae4ee9df00
7 changed files with 54 additions and 31 deletions

View file

@ -353,7 +353,9 @@ void p3disc::sendPeerDetails(std::string to, std::string about) {
rsPeerNetItem->currentlocaladdr = detail.currentlocaladdr;
rsPeerNetItem->currentremoteaddr = detail.currentserveraddr;
rsPeerNetItem->dyndns = detail.dyndns;
rsPeerNetItem->ipAddressList = detail.getIpAddressList();
detail.ipAddrs.mLocal.loadTlv(rsPeerNetItem->localAddrList);
detail.ipAddrs.mExt.loadTlv(rsPeerNetItem->extAddrList);
di->rsPeerList.push_back(*rsPeerNetItem);
}
@ -377,7 +379,9 @@ void p3disc::sendPeerDetails(std::string to, std::string about) {
rsPeerNetItem->currentlocaladdr = detail.currentlocaladdr;
rsPeerNetItem->currentremoteaddr = detail.currentserveraddr;
rsPeerNetItem->dyndns = detail.dyndns;
rsPeerNetItem->ipAddressList = detail.getIpAddressList();
detail.ipAddrs.mLocal.loadTlv(rsPeerNetItem->localAddrList);
detail.ipAddrs.mExt.loadTlv(rsPeerNetItem->extAddrList);
di->rsPeerList.push_back(*rsPeerNetItem);
}
@ -610,18 +614,25 @@ void p3disc::recvPeerDetails(RsDiscReply *item)
merge = false ;
}
}
pqiIpAddrSet addrsFromPeer;
addrsFromPeer.mLocal.loadTlv(pitem->localAddrList);
addrsFromPeer.mExt.loadTlv(pitem->extAddrList);
#ifdef P3DISC_DEBUG
std::cerr << "Friend is already connected -> not updating" << std::endl;
std::cerr << "Setting address list to peer " << pitem->pid << ", to be:" << std::endl ;
for(std::list<IpAddressTimed>::const_iterator it(pitem->ipAddressList.begin());it!=pitem->ipAddressList.end();++it)
std::cerr << " " << (*it).ipAddr << " (" << (*it).seenTime << ")" << std::endl ;
addrsFromPeer.printAddrs(std::cerr);
std::cerr << std::endl;
#endif
// allways update address list and dns, except if it's ours
if (pitem->dyndns != "")
mConnMgr->setDynDNS(pitem->pid, pitem->dyndns);
mConnMgr->updateAddressList(pitem->pid, pitem->ipAddressList,merge);
mConnMgr->updateAddressList(pitem->pid, addrsFromPeer);
}
#ifdef P3DISC_DEBUG
else