|
|
@ -101,19 +101,19 @@ namespace transport
|
|
|
|
|
|
|
|
|
|
|
|
void UPnP::Run ()
|
|
|
|
void UPnP::Run ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::vector<data::RouterInfo::Address> a = context.GetRouterInfo().GetAddresses();
|
|
|
|
auto& a = context.GetRouterInfo().GetAddresses();
|
|
|
|
for (auto& address : a)
|
|
|
|
for (auto address : a)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!address.host.is_v6 ())
|
|
|
|
if (!address->host.is_v6 ())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Discover ();
|
|
|
|
Discover ();
|
|
|
|
if (address.transportStyle == data::RouterInfo::eTransportSSU )
|
|
|
|
if (address->transportStyle == data::RouterInfo::eTransportSSU )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TryPortMapping (I2P_UPNP_UDP, address.port);
|
|
|
|
TryPortMapping (I2P_UPNP_UDP, address->port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (address.transportStyle == data::RouterInfo::eTransportNTCP )
|
|
|
|
else if (address->transportStyle == data::RouterInfo::eTransportNTCP )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TryPortMapping (I2P_UPNP_TCP, address.port);
|
|
|
|
TryPortMapping (I2P_UPNP_TCP, address->port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|