|
|
@ -159,8 +159,9 @@ namespace transport |
|
|
|
|
|
|
|
|
|
|
|
void UPnP::PortMapping () |
|
|
|
void UPnP::PortMapping () |
|
|
|
{ |
|
|
|
{ |
|
|
|
const auto& a = context.GetRouterInfo().GetAddresses(); |
|
|
|
auto a = context.GetRouterInfo().GetAddresses(); |
|
|
|
for (const auto& address : a) |
|
|
|
if (!a) return; |
|
|
|
|
|
|
|
for (const auto& address : *a) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!address->host.is_v6 () && address->port) |
|
|
|
if (!address->host.is_v6 () && address->port) |
|
|
|
TryPortMapping (address); |
|
|
|
TryPortMapping (address); |
|
|
@ -210,8 +211,9 @@ namespace transport |
|
|
|
|
|
|
|
|
|
|
|
void UPnP::CloseMapping () |
|
|
|
void UPnP::CloseMapping () |
|
|
|
{ |
|
|
|
{ |
|
|
|
const auto& a = context.GetRouterInfo().GetAddresses(); |
|
|
|
const a = context.GetRouterInfo().GetAddresses(); |
|
|
|
for (const auto& address : a) |
|
|
|
if (!a) return; |
|
|
|
|
|
|
|
for (const auto& address : *a) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!address->host.is_v6 () && address->port) |
|
|
|
if (!address->host.is_v6 () && address->port) |
|
|
|
CloseMapping (address); |
|
|
|
CloseMapping (address); |
|
|
|