From 7a7a4fc8d748cff9a3299cc2fc7274df950c1aae Mon Sep 17 00:00:00 2001 From: joss17 Date: Fri, 30 Oct 2009 00:37:12 +0000 Subject: [PATCH] better flag management git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1755 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3connmgr.cc | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index 01aa73b1c..8d2bf93ae 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -132,7 +132,6 @@ p3ConnectMgr::p3ConnectMgr(p3AuthMgr *am) mStunStatus(0), mStunFound(0), mStunMoreRequired(true), mStatusChanged(false) { - netFlagOk = false; mUpnpAddrValid = false; mStunAddrValid = false; mStunAddrStable = false; @@ -306,7 +305,7 @@ void p3ConnectMgr::netReset() { RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/ mNetStatus = RS_NET_UNKNOWN; - netFlagOk = false; + netStatusReset(); } std::cerr << "p3ConnectMgr::netReset() checkNetAddress" << std::endl; @@ -346,6 +345,7 @@ void p3ConnectMgr::addNetListener(pqiNetListener *listener) void p3ConnectMgr::netStatusReset() { + netFlagOk = false; netFlagUpnpOk = false; netFlagDhtOk = false; netFlagExtOk = false; @@ -368,7 +368,6 @@ void p3ConnectMgr::netStartup() netDhtInit(); netUdpInit(); netStunInit(); - netStatusReset(); /* decide which net setup mode we're going into */ @@ -419,17 +418,7 @@ void p3ConnectMgr::tick() bool p3ConnectMgr::shutdown() /* blocking shutdown call */ { - connMtx.lock(); /* LOCK MUTEX */ - - bool upnpActive = ownState.netMode & RS_NET_MODE_UPNP; - mNetStatus = RS_NET_MODE_DOWN; - - connMtx.unlock(); /* UNLOCK MUTEX */ - - if (upnpActive) - { - netAssistFirewallShutdown(); - } + netAssistFirewallShutdown(); netAssistConnectShutdown(); return true;