From c377283426650f0630290f429b76ccc310ad8a7c Mon Sep 17 00:00:00 2001 From: joss17 Date: Wed, 22 Jul 2009 09:33:21 +0000 Subject: [PATCH] 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 --- libretroshare/src/pqi/p3connmgr.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index 75d172eb6..31099e33b 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -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) {