From 54276344ad81f021edba7f3086b19a9e5f0d7bd8 Mon Sep 17 00:00:00 2001 From: joss17 Date: Fri, 30 Oct 2009 00:37:45 +0000 Subject: [PATCH] add reset net status when shutingdown git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1757 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/p3connmgr.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/pqi/p3connmgr.cc b/libretroshare/src/pqi/p3connmgr.cc index 8d2bf93ae..c2ddc078e 100644 --- a/libretroshare/src/pqi/p3connmgr.cc +++ b/libretroshare/src/pqi/p3connmgr.cc @@ -57,7 +57,7 @@ const uint32_t RS_STUN_FOUND_MIN = 10; const uint32_t MAX_UPNP_INIT = 100; /* seconds UPnP timeout */ const uint32_t MAX_UDP_INIT = 120; /* seconds Udp timeout */ -const uint32_t MIN_TIME_BETWEEN_NET_RESET = 20; /* seconds Udp timeout */ +const uint32_t MIN_TIME_BETWEEN_NET_RESET = 5; /**** * #define CONN_DEBUG 1 @@ -418,6 +418,12 @@ void p3ConnectMgr::tick() bool p3ConnectMgr::shutdown() /* blocking shutdown call */ { + { + RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/ + mNetStatus = RS_NET_UNKNOWN; + mNetInitTS = time(NULL); + netStatusReset(); + } netAssistFirewallShutdown(); netAssistConnectShutdown(); @@ -993,7 +999,6 @@ void p3ConnectMgr::stunInit() * The status is passed onto the DHT. * */ - bool p3ConnectMgr::stunCheck() {