Expose ToS setting from libtorrent

Closes #14420.
This commit is contained in:
Chocobo1 2021-03-06 14:17:07 +08:00
parent 9a567721a8
commit 5161758193
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
6 changed files with 46 additions and 3 deletions

View file

@ -309,6 +309,8 @@ void AppController::preferencesAction()
data["outgoing_ports_max"] = session->outgoingPortsMax();
// UPnP lease duration
data["upnp_lease_duration"] = session->UPnPLeaseDuration();
// Type of service
data["peer_tos"] = session->peerToS();
// uTP-TCP mixed mode
data["utp_tcp_mixed_mode"] = static_cast<int>(session->utpMixedMode());
// Support internationalized domain name (IDN)
@ -772,6 +774,9 @@ void AppController::setPreferencesAction()
// UPnP lease duration
if (hasKey("upnp_lease_duration"))
session->setUPnPLeaseDuration(it.value().toInt());
// Type of service
if (hasKey("peer_tos"))
session->setPeerToS(it.value().toInt());
// uTP-TCP mixed mode
if (hasKey("utp_tcp_mixed_mode"))
session->setUtpMixedMode(static_cast<BitTorrent::MixedModeAlgorithm>(it.value().toInt()));