mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-13 00:53:14 -04:00
better flag management
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1755 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
20cff8ecbd
commit
7a7a4fc8d7
1 changed files with 3 additions and 14 deletions
|
@ -132,7 +132,6 @@ p3ConnectMgr::p3ConnectMgr(p3AuthMgr *am)
|
||||||
mStunStatus(0), mStunFound(0), mStunMoreRequired(true),
|
mStunStatus(0), mStunFound(0), mStunMoreRequired(true),
|
||||||
mStatusChanged(false)
|
mStatusChanged(false)
|
||||||
{
|
{
|
||||||
netFlagOk = false;
|
|
||||||
mUpnpAddrValid = false;
|
mUpnpAddrValid = false;
|
||||||
mStunAddrValid = false;
|
mStunAddrValid = false;
|
||||||
mStunAddrStable = false;
|
mStunAddrStable = false;
|
||||||
|
@ -306,7 +305,7 @@ void p3ConnectMgr::netReset()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||||
mNetStatus = RS_NET_UNKNOWN;
|
mNetStatus = RS_NET_UNKNOWN;
|
||||||
netFlagOk = false;
|
netStatusReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "p3ConnectMgr::netReset() checkNetAddress" << std::endl;
|
std::cerr << "p3ConnectMgr::netReset() checkNetAddress" << std::endl;
|
||||||
|
@ -346,6 +345,7 @@ void p3ConnectMgr::addNetListener(pqiNetListener *listener)
|
||||||
|
|
||||||
void p3ConnectMgr::netStatusReset()
|
void p3ConnectMgr::netStatusReset()
|
||||||
{
|
{
|
||||||
|
netFlagOk = false;
|
||||||
netFlagUpnpOk = false;
|
netFlagUpnpOk = false;
|
||||||
netFlagDhtOk = false;
|
netFlagDhtOk = false;
|
||||||
netFlagExtOk = false;
|
netFlagExtOk = false;
|
||||||
|
@ -368,7 +368,6 @@ void p3ConnectMgr::netStartup()
|
||||||
netDhtInit();
|
netDhtInit();
|
||||||
netUdpInit();
|
netUdpInit();
|
||||||
netStunInit();
|
netStunInit();
|
||||||
netStatusReset();
|
|
||||||
|
|
||||||
/* decide which net setup mode we're going into
|
/* decide which net setup mode we're going into
|
||||||
*/
|
*/
|
||||||
|
@ -419,17 +418,7 @@ void p3ConnectMgr::tick()
|
||||||
|
|
||||||
bool p3ConnectMgr::shutdown() /* blocking shutdown call */
|
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();
|
netAssistConnectShutdown();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue