changed the order of upnp/stun and extaddrFinder to limit wrong analysis of firewalled situation

Conflicts:

	libretroshare/src/pqi/p3connmgr.cc

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.4.x@1404 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-07-22 09:33:21 +00:00
parent 8f33cf3610
commit c377283426

View file

@ -64,7 +64,6 @@ const uint32_t MAX_UPNP_INIT = 10; /* seconds UPnP timeout */
* #define P3CONNMGR_NO_AUTO_CONNECTION 1
***/
const uint32_t P3CONNMGR_TCP_DEFAULT_DELAY = 2; /* 2 Seconds? is it be enough! */
const uint32_t P3CONNMGR_UDP_DHT_DELAY = DHT_NOTIFY_PERIOD + 60; /* + 1 minute for DHT POST */
const uint32_t P3CONNMGR_UDP_PROXY_DELAY = 30; /* 30 seconds (NOT IMPLEMENTED YET!) */
@ -608,7 +607,14 @@ void p3ConnectMgr::netUdpCheck()
/* get the addr from the configuration */
struct sockaddr_in iaddr = ownState.localaddr;
if (mUpnpAddrValid)
if(use_extr_addr_finder && mExtAddrFinder->hasValidIP(&tmpip))
{
extValid = true;
extAddr = tmpip ;
extAddr.sin_port = iaddr.sin_port ;
extAddrStable = true;
}
else if (mUpnpAddrValid)
{
extValid = true;
extAddr = mUpnpExtAddr;
@ -620,13 +626,6 @@ void p3ConnectMgr::netUdpCheck()
extAddr = mStunExtAddr;
extAddrStable = mStunAddrStable;
}
else if(use_extr_addr_finder && mExtAddrFinder->hasValidIP(&tmpip))
{
extValid = true;
extAddr = tmpip ;
extAddr.sin_port = iaddr.sin_port ;
extAddrStable = true;
}
if (extValid)
{