mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Added uTP support
This commit is contained in:
parent
ea433c0619
commit
641b38690c
10 changed files with 216 additions and 57 deletions
|
@ -453,6 +453,34 @@ void QBtSession::configureSession() {
|
|||
s->set_max_half_open_connections(pref.getMaxHalfOpenConnections());
|
||||
// * Max connections limit
|
||||
setMaxConnections(pref.getMaxConnecs());
|
||||
#endif
|
||||
#if LIBTORRENT_VERSION_MINOR > 15
|
||||
// uTP
|
||||
switch((int)pref.getBTProtocol()) {
|
||||
case BT::TCP_uTP:
|
||||
sessionSettings.enable_incoming_tcp = true;
|
||||
sessionSettings.enable_outgoing_tcp = true;
|
||||
sessionSettings.enable_incoming_utp = true;
|
||||
sessionSettings.enable_outgoing_utp = true;
|
||||
break;
|
||||
case BT::TCP:
|
||||
sessionSettings.enable_incoming_tcp = true;
|
||||
sessionSettings.enable_outgoing_tcp = true;
|
||||
sessionSettings.enable_incoming_utp = false;
|
||||
sessionSettings.enable_outgoing_utp = false;
|
||||
break;
|
||||
case BT::uTP:
|
||||
sessionSettings.enable_incoming_tcp = false;
|
||||
sessionSettings.enable_outgoing_tcp = false;
|
||||
sessionSettings.enable_incoming_utp = true;
|
||||
sessionSettings.enable_outgoing_utp = true;
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
// uTP rate limiting
|
||||
sessionSettings.rate_limit_utp = pref.isuTPRateLimited();
|
||||
#endif
|
||||
qDebug() << "Settings SessionSettings";
|
||||
setSessionSettings(sessionSettings);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue