mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
change the way we handle our own address when recieving a disc item
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1901 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2ed7a96245
commit
4a53fdc0a9
@ -1349,7 +1349,7 @@ const std::string p3ConnectMgr::getOwnId()
|
||||
bool p3ConnectMgr::getOwnNetStatus(peerConnectState &state)
|
||||
{
|
||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||
state = ownState;
|
||||
state = ownState;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2485,29 +2485,8 @@ bool p3ConnectMgr::setAddressList(std::string id, std::list<IpAddressTimed> I
|
||||
{
|
||||
/* check if it is our own ip */
|
||||
if (id == getOwnId()) {
|
||||
struct sockaddr_in extAddr;
|
||||
if (getUpnpExtAddress(extAddr) || getExtFinderExtAddress(extAddr)) {
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "p3ConnectMgr::setAddressList() received own ip address list, but already got an external address with upnp or extaddrfinder." << std::endl;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
IpAddressTimed extractedAddress;
|
||||
if (peerConnectState::extractExtAddress(IpAddressTimedList, extractedAddress)) {
|
||||
#ifdef CONN_DEBUG
|
||||
std::cerr << "p3ConnectMgr::setAddressList() got a valid own external address." << std::endl;
|
||||
#endif
|
||||
setExtAddress(getOwnId(), extractedAddress.ipAddr);
|
||||
IndicateConfigChanged();
|
||||
return true;
|
||||
} else {
|
||||
#ifdef CONN_DEBUG
|
||||
rslog(RSL_DEBUG_BASIC, p3connectzone, "p3ConnectMgr::setAddressList() no valid external address found for own address ");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
ownState.updateIpAddressList(IpAddressTimedList);
|
||||
return true;
|
||||
}
|
||||
|
||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
Loading…
Reference in New Issue
Block a user