Expose libtorrent max_concurrent_http_announces in advanced settings

This commit is contained in:
an0n666
2020-09-03 09:24:30 +06:00
parent 1c87073990
commit 73b39a8dec
6 changed files with 51 additions and 5 deletions

View File

@@ -320,7 +320,7 @@ void AppController::preferencesAction()
data["announce_to_all_trackers"] = session->announceToAllTrackers();
data["announce_to_all_tiers"] = session->announceToAllTiers();
data["announce_ip"] = session->announceIP();
// Stop tracker timeout
data["max_concurrent_http_announces"] = session->maxConcurrentHTTPAnnounces();
data["stop_tracker_timeout"] = session->stopTrackerTimeout();
// Peer Turnover
data["peer_turnover"] = session->peerTurnover();
@@ -769,7 +769,8 @@ void AppController::setPreferencesAction()
const QHostAddress announceAddr {it.value().toString().trimmed()};
session->setAnnounceIP(announceAddr.isNull() ? QString {} : announceAddr.toString());
}
// Stop tracker timeout
if (hasKey("max_concurrent_http_announces"))
session->setMaxConcurrentHTTPAnnounces(it.value().toInt());
if (hasKey("stop_tracker_timeout"))
session->setStopTrackerTimeout(it.value().toInt());
// Peer Turnover

View File

@@ -1153,6 +1153,14 @@
<input type="text" id="announceIP" style="width: 15em;" />
</td>
</tr>
<tr>
<td>
<label for="maxConcurrentHTTPAnnounces">QBT_TR(Max concurrent HTTP announces (requires libtorrent >= 1.2.7):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#max_concurrent_http_announces" target="_blank">(?)</a></label>
</td>
<td>
<input type="text" id="maxConcurrentHTTPAnnounces" style="width: 15em;" />
</td>
</tr>
<tr>
<td>
<label for="stopTrackerTimeout">QBT_TR(Stop tracker timeout:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#stop_tracker_timeout" target="_blank">(?)</a></label>
@@ -1880,6 +1888,7 @@
$('announceAllTrackers').setProperty('checked', pref.announce_to_all_trackers);
$('announceAllTiers').setProperty('checked', pref.announce_to_all_tiers);
$('announceIP').setProperty('value', pref.announce_ip);
$('maxConcurrentHTTPAnnounces').setProperty('value', pref.max_concurrent_http_announces);
$('stopTrackerTimeout').setProperty('value', pref.stop_tracker_timeout);
$('peerTurnover').setProperty('value', pref.peer_turnover);
$('peerTurnoverCutoff').setProperty('value', pref.peer_turnover_cutoff);
@@ -2264,6 +2273,7 @@
settings.set('announce_to_all_trackers', $('announceAllTrackers').getProperty('checked'));
settings.set('announce_to_all_tiers', $('announceAllTiers').getProperty('checked'));
settings.set('announce_ip', $('announceIP').getProperty('value'));
settings.set('max_concurrent_http_announces', $('maxConcurrentHTTPAnnounces').getProperty('value'));
settings.set('stop_tracker_timeout', $('stopTrackerTimeout').getProperty('value'));
settings.set('peer_turnover', $('peerTurnover').getProperty('value'));
settings.set('peer_turnover_cutoff', $('peerTurnoverCutoff').getProperty('value'));