mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 13:48:05 -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:
@@ -163,6 +163,7 @@ namespace
|
||||
ANNOUNCE_ALL_TRACKERS,
|
||||
ANNOUNCE_ALL_TIERS,
|
||||
ANNOUNCE_IP,
|
||||
ANNOUNCE_PORT,
|
||||
MAX_CONCURRENT_HTTP_ANNOUNCES,
|
||||
STOP_TRACKER_TIMEOUT,
|
||||
PEER_TURNOVER,
|
||||
@@ -309,6 +310,8 @@ void AdvancedSettings::saveAdvancedSettings() const
|
||||
// Construct a QHostAddress to filter malformed strings
|
||||
const QHostAddress addr(m_lineEditAnnounceIP.text().trimmed());
|
||||
session->setAnnounceIP(addr.toString());
|
||||
// Announce Port
|
||||
session->setAnnouncePort(m_spinBoxAnnouncePort.value());
|
||||
// Max concurrent HTTP announces
|
||||
session->setMaxConcurrentHTTPAnnounces(m_spinBoxMaxConcurrentHTTPAnnounces.value());
|
||||
// Stop tracker timeout
|
||||
@@ -801,6 +804,13 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
addRow(ANNOUNCE_IP, (tr("IP address reported to trackers (requires restart)")
|
||||
+ u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#announce_ip", u"(?)"))
|
||||
, &m_lineEditAnnounceIP);
|
||||
// Announce port
|
||||
m_spinBoxAnnouncePort.setMinimum(0);
|
||||
m_spinBoxAnnouncePort.setMaximum(65535);
|
||||
m_spinBoxAnnouncePort.setValue(session->announcePort());
|
||||
addRow(ANNOUNCE_PORT, (tr("Port reported to trackers (requires restart) [0: listening port]")
|
||||
+ u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#announce_port", u"(?)"))
|
||||
, &m_spinBoxAnnouncePort);
|
||||
// Max concurrent HTTP announces
|
||||
m_spinBoxMaxConcurrentHTTPAnnounces.setMaximum(std::numeric_limits<int>::max());
|
||||
m_spinBoxMaxConcurrentHTTPAnnounces.setValue(session->maxConcurrentHTTPAnnounces());
|
||||
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
m_spinBoxOutgoingPortsMin, m_spinBoxOutgoingPortsMax, m_spinBoxUPnPLeaseDuration, m_spinBoxPeerToS,
|
||||
m_spinBoxListRefresh, m_spinBoxTrackerPort, m_spinBoxSendBufferWatermark, m_spinBoxSendBufferLowWatermark,
|
||||
m_spinBoxSendBufferWatermarkFactor, m_spinBoxConnectionSpeed, m_spinBoxSocketSendBufferSize, m_spinBoxSocketReceiveBufferSize, m_spinBoxSocketBacklogSize,
|
||||
m_spinBoxMaxConcurrentHTTPAnnounces, m_spinBoxStopTrackerTimeout, m_spinBoxSessionShutdownTimeout,
|
||||
m_spinBoxAnnouncePort, m_spinBoxMaxConcurrentHTTPAnnounces, m_spinBoxStopTrackerTimeout, m_spinBoxSessionShutdownTimeout,
|
||||
m_spinBoxSavePathHistoryLength, m_spinBoxPeerTurnover, m_spinBoxPeerTurnoverCutoff, m_spinBoxPeerTurnoverInterval, m_spinBoxRequestQueueSize;
|
||||
QCheckBox m_checkBoxOsCache, m_checkBoxRecheckCompleted, m_checkBoxResolveCountries, m_checkBoxResolveHosts,
|
||||
m_checkBoxProgramNotifications, m_checkBoxTorrentAddedNotifications, m_checkBoxReannounceWhenAddressChanged, m_checkBoxTrackerFavicon, m_checkBoxTrackerStatus,
|
||||
|
||||
Reference in New Issue
Block a user