mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-05 05:12:51 -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
1 changed files with 3 additions and 24 deletions
|
@ -1349,7 +1349,7 @@ const std::string p3ConnectMgr::getOwnId()
|
||||||
bool p3ConnectMgr::getOwnNetStatus(peerConnectState &state)
|
bool p3ConnectMgr::getOwnNetStatus(peerConnectState &state)
|
||||||
{
|
{
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
state = ownState;
|
state = ownState;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2485,29 +2485,8 @@ bool p3ConnectMgr::setAddressList(std::string id, std::list<IpAddressTimed> I
|
||||||
{
|
{
|
||||||
/* check if it is our own ip */
|
/* check if it is our own ip */
|
||||||
if (id == getOwnId()) {
|
if (id == getOwnId()) {
|
||||||
struct sockaddr_in extAddr;
|
ownState.updateIpAddressList(IpAddressTimedList);
|
||||||
if (getUpnpExtAddress(extAddr) || getExtFinderExtAddress(extAddr)) {
|
return true;
|
||||||
#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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue