@@ -33,8 +33,8 @@ static_assert(MINIUPNPC_API_VERSION >= 10, "miniUPnPc API version >= 10 assumed"
33
33
#include < thread>
34
34
35
35
#ifdef USE_UPNP
36
- static CThreadInterrupt g_upnp_interrupt ;
37
- static std::thread g_upnp_thread ;
36
+ static CThreadInterrupt g_mapport_interrupt ;
37
+ static std::thread g_mapport_thread ;
38
38
static std::atomic_uint g_mapport_target_proto{MapPortProtoFlag::NONE};
39
39
40
40
using namespace std ::chrono_literals;
@@ -74,7 +74,7 @@ static bool ProcessUpnp()
74
74
CNetAddr resolved;
75
75
if (LookupHost (externalIPAddress, resolved, false )) {
76
76
LogPrintf (" UPnP: ExternalIPAddress = %s\n " , resolved.ToString ());
77
- AddLocal (resolved, LOCAL_UPNP );
77
+ AddLocal (resolved, LOCAL_MAPPED );
78
78
}
79
79
} else {
80
80
LogPrintf (" UPnP: GetExternalIPAddress failed.\n " );
@@ -95,8 +95,8 @@ static bool ProcessUpnp()
95
95
ret = true ;
96
96
LogPrintf (" UPnP Port Mapping successful.\n " );
97
97
}
98
- } while (g_upnp_interrupt .sleep_for (PORT_MAPPING_REANNOUNCE_PERIOD));
99
- g_upnp_interrupt .reset ();
98
+ } while (g_mapport_interrupt .sleep_for (PORT_MAPPING_REANNOUNCE_PERIOD));
99
+ g_mapport_interrupt .reset ();
100
100
101
101
r = UPNP_DeletePortMapping (urls.controlURL , data.first .servicetype , port.c_str (), " TCP" , 0 );
102
102
LogPrintf (" UPNP_DeletePortMapping() returned: %d\n " , r);
@@ -116,14 +116,14 @@ static void ThreadMapPort()
116
116
{
117
117
do {
118
118
if (ProcessUpnp ()) return ;
119
- } while (g_upnp_interrupt .sleep_for (PORT_MAPPING_RETRY_PERIOD));
119
+ } while (g_mapport_interrupt .sleep_for (PORT_MAPPING_RETRY_PERIOD));
120
120
}
121
121
122
122
void StartThreadMapPort ()
123
123
{
124
- if (!g_upnp_thread .joinable ()) {
125
- assert (!g_upnp_interrupt );
126
- g_upnp_thread = std::thread ((std::bind (&TraceThread<void (*)()>, " upnp " , &ThreadMapPort)));
124
+ if (!g_mapport_thread .joinable ()) {
125
+ assert (!g_mapport_interrupt );
126
+ g_mapport_thread = std::thread ((std::bind (&TraceThread<void (*)()>, " mapport " , &ThreadMapPort)));
127
127
}
128
128
}
129
129
@@ -154,16 +154,16 @@ void StartMapPort(bool use_upnp)
154
154
155
155
void InterruptMapPort ()
156
156
{
157
- if (g_upnp_thread .joinable ()) {
158
- g_upnp_interrupt ();
157
+ if (g_mapport_thread .joinable ()) {
158
+ g_mapport_interrupt ();
159
159
}
160
160
}
161
161
162
162
void StopMapPort ()
163
163
{
164
- if (g_upnp_thread .joinable ()) {
165
- g_upnp_thread .join ();
166
- g_upnp_interrupt .reset ();
164
+ if (g_mapport_thread .joinable ()) {
165
+ g_mapport_thread .join ();
166
+ g_mapport_interrupt .reset ();
167
167
}
168
168
}
169
169
0 commit comments