File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 2626static CThreadInterrupt g_mapport_interrupt;
2727static std::thread g_mapport_thread;
2828static std::atomic_bool g_mapport_enabled{false };
29- static std::atomic_bool g_mapport_current{false };
3029
3130using namespace std ::chrono_literals;
3231static constexpr auto PORT_MAPPING_REANNOUNCE_PERIOD{20min};
@@ -130,12 +129,10 @@ static void ThreadMapPort()
130129 ok = false ;
131130
132131 if (g_mapport_enabled) {
133- g_mapport_current = true ;
134132 ok = ProcessPCP ();
135133 if (ok) continue ;
136134 }
137135
138- g_mapport_current = false ;
139136 if (!g_mapport_enabled) {
140137 return ;
141138 }
@@ -154,9 +151,9 @@ void StartThreadMapPort()
154151void StartMapPort (bool enable)
155152{
156153 g_mapport_enabled = enable;
157- if (!g_mapport_current && g_mapport_enabled) {
154+ if (g_mapport_enabled) {
158155 StartThreadMapPort ();
159- } else if (g_mapport_current && !g_mapport_enabled) {
156+ } else {
160157 InterruptMapPort ();
161158 StopMapPort ();
162159 }
You can’t perform that action at this time.
0 commit comments