mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
fix: re-enable port forwarding (#4343)
This commit is contained in:
parent
84c0001e2f
commit
b0eaec47cd
2 changed files with 7 additions and 2 deletions
|
@ -284,11 +284,11 @@ tr_port_forwarding_state tr_upnpPulse(tr_upnp* handle, tr_port port, bool is_ena
|
|||
|
||||
FreeUPNPUrls(&handle->urls);
|
||||
auto lanaddr = std::array<char, TR_ADDRSTRLEN>{};
|
||||
if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr)) ==
|
||||
if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1) ==
|
||||
UPNP_IGD_VALID_CONNECTED)
|
||||
{
|
||||
tr_logAddInfo(fmt::format(_("Found Internet Gateway Device '{url}'"), fmt::arg("url", handle->urls.controlURL)));
|
||||
tr_logAddInfo(fmt::format(_("Local Address is '{address}'"), fmt::arg("address", handle->lanaddr.data())));
|
||||
tr_logAddInfo(fmt::format(_("Local Address is '{address}'"), fmt::arg("address", lanaddr.data())));
|
||||
handle->state = UpnpState::Idle;
|
||||
handle->hasDiscovered = true;
|
||||
handle->lanaddr = std::data(lanaddr);
|
||||
|
|
|
@ -666,6 +666,11 @@ void tr_session::setSettings(tr_session_settings&& settings_in, bool force)
|
|||
addr_changed = true;
|
||||
}
|
||||
|
||||
if (auto const& val = new_settings.port_forwarding_enabled; force || val != old_settings.port_forwarding_enabled)
|
||||
{
|
||||
tr_sessionSetPortForwardingEnabled(this, val);
|
||||
}
|
||||
|
||||
if (port_changed)
|
||||
{
|
||||
port_forwarding_->localPortChanged();
|
||||
|
|
Loading…
Reference in a new issue