mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 20:58:07 -06:00
Add connection_speed to advanced settings
Now we follow libtorrent current default value 30. Closes #6973. Also bump WebAPI version.
This commit is contained in:
@@ -302,6 +302,8 @@ void AppController::preferencesAction()
|
||||
data["send_buffer_watermark"] = session->sendBufferWatermark();
|
||||
data["send_buffer_low_watermark"] = session->sendBufferLowWatermark();
|
||||
data["send_buffer_watermark_factor"] = session->sendBufferWatermarkFactor();
|
||||
// Outgoing connections per second
|
||||
data["connection_speed"] = session->connectionSpeed();
|
||||
// Socket listen backlog size
|
||||
data["socket_backlog_size"] = session->socketBacklogSize();
|
||||
// Outgoing ports
|
||||
@@ -754,6 +756,9 @@ void AppController::setPreferencesAction()
|
||||
session->setSendBufferLowWatermark(it.value().toInt());
|
||||
if (hasKey("send_buffer_watermark_factor"))
|
||||
session->setSendBufferWatermarkFactor(it.value().toInt());
|
||||
// Outgoing connections per second
|
||||
if (hasKey("connection_speed"))
|
||||
session->setConnectionSpeed(it.value().toInt());
|
||||
// Socket listen backlog size
|
||||
if (hasKey("socket_backlog_size"))
|
||||
session->setSocketBacklogSize(it.value().toInt());
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
#include "api/torrentscontroller.h"
|
||||
#include "api/transfercontroller.h"
|
||||
|
||||
constexpr int MAX_ALLOWED_FILESIZE = 10 * 1024 * 1024;
|
||||
const int MAX_ALLOWED_FILESIZE = 10 * 1024 * 1024;
|
||||
const char C_SID[] = "SID"; // name of session id cookie
|
||||
|
||||
const QString PATH_PREFIX_ICONS {QStringLiteral("/icons/")};
|
||||
const QString WWW_FOLDER {QStringLiteral(":/www")};
|
||||
|
||||
@@ -43,13 +43,11 @@
|
||||
#include "base/utils/net.h"
|
||||
#include "base/utils/version.h"
|
||||
|
||||
constexpr Utils::Version<int, 3, 2> API_VERSION {2, 8, 2};
|
||||
inline const Utils::Version<int, 3, 2> API_VERSION {2, 8, 3};
|
||||
|
||||
class APIController;
|
||||
class WebApplication;
|
||||
|
||||
constexpr char C_SID[] = "SID"; // name of session id cookie
|
||||
|
||||
class WebSession final : public ISession
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1047,6 +1047,14 @@
|
||||
<input type="text" id="sendBufferWatermarkFactor" style="width: 15em;" /> %
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="connectionSpeed">QBT_TR(Outgoing connections per second:)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#connection_speed" target="_blank">(?)</a></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="connectionSpeed" style="width: 15em;" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="socketBacklogSize">QBT_TR(Socket backlog size:)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#listen_queue_size" target="_blank">(?)</a></label>
|
||||
@@ -1896,6 +1904,7 @@
|
||||
$('sendBufferWatermark').setProperty('value', pref.send_buffer_watermark);
|
||||
$('sendBufferLowWatermark').setProperty('value', pref.send_buffer_low_watermark);
|
||||
$('sendBufferWatermarkFactor').setProperty('value', pref.send_buffer_watermark_factor);
|
||||
$('connectionSpeed').setProperty('value', pref.connection_speed);
|
||||
$('socketBacklogSize').setProperty('value', pref.socket_backlog_size);
|
||||
$('outgoingPortsMin').setProperty('value', pref.outgoing_ports_min);
|
||||
$('outgoingPortsMax').setProperty('value', pref.outgoing_ports_max);
|
||||
@@ -2285,6 +2294,7 @@
|
||||
settings.set('send_buffer_watermark', $('sendBufferWatermark').getProperty('value'));
|
||||
settings.set('send_buffer_low_watermark', $('sendBufferLowWatermark').getProperty('value'));
|
||||
settings.set('send_buffer_watermark_factor', $('sendBufferWatermarkFactor').getProperty('value'));
|
||||
settings.set('connection_speed', $('connectionSpeed').getProperty('value'));
|
||||
settings.set('socket_backlog_size', $('socketBacklogSize').getProperty('value'));
|
||||
settings.set('outgoing_ports_min', $('outgoingPortsMin').getProperty('value'));
|
||||
settings.set('outgoing_ports_max', $('outgoingPortsMax').getProperty('value'));
|
||||
|
||||
Reference in New Issue
Block a user