mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Add announce_port support
The `announce_port` setting permits to overwrite the port passed along to trackers as the `&port=` parameter. If left as the default, the listening port is used. This setting is only meant for very special cases where a seed's listening port differs from the effectively exposed port (e.g., through external NAT-PMP). See https://github.com/arvidn/libtorrent/pull/7771 for an example use-case. This PR adds the relevant setting alongside the existing `announce_ip` setting. PR #21692.
This commit is contained in:
@@ -473,6 +473,7 @@ void AppController::preferencesAction()
|
||||
data[u"announce_to_all_trackers"_s] = session->announceToAllTrackers();
|
||||
data[u"announce_to_all_tiers"_s] = session->announceToAllTiers();
|
||||
data[u"announce_ip"_s] = session->announceIP();
|
||||
data[u"announce_port"_s] = session->announcePort();
|
||||
data[u"max_concurrent_http_announces"_s] = session->maxConcurrentHTTPAnnounces();
|
||||
data[u"stop_tracker_timeout"_s] = session->stopTrackerTimeout();
|
||||
// Peer Turnover
|
||||
@@ -1144,6 +1145,8 @@ void AppController::setPreferencesAction()
|
||||
const QHostAddress announceAddr {it.value().toString().trimmed()};
|
||||
session->setAnnounceIP(announceAddr.isNull() ? QString {} : announceAddr.toString());
|
||||
}
|
||||
if (hasKey(u"announce_port"_s))
|
||||
session->setAnnouncePort(it.value().toInt());
|
||||
if (hasKey(u"max_concurrent_http_announces"_s))
|
||||
session->setMaxConcurrentHTTPAnnounces(it.value().toInt());
|
||||
if (hasKey(u"stop_tracker_timeout"_s))
|
||||
|
||||
Reference in New Issue
Block a user