mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
Merge pull request #14976 from Chocobo1/options
Add `connection_speed` to advanced settings
This commit is contained in:
commit
40f6201509
@ -386,7 +386,7 @@ void BitTorrent::DBResumeDataStorage::createDB() const
|
|||||||
if (!db.commit())
|
if (!db.commit())
|
||||||
throw RuntimeError(db.lastError().text());
|
throw RuntimeError(db.lastError().text());
|
||||||
}
|
}
|
||||||
catch (const RuntimeError &err)
|
catch (const RuntimeError &)
|
||||||
{
|
{
|
||||||
db.rollback();
|
db.rollback();
|
||||||
throw;
|
throw;
|
||||||
@ -563,7 +563,7 @@ void BitTorrent::DBResumeDataStorage::Worker::storeQueue(const QVector<TorrentID
|
|||||||
if (!db.commit())
|
if (!db.commit())
|
||||||
throw RuntimeError(db.lastError().text());
|
throw RuntimeError(db.lastError().text());
|
||||||
}
|
}
|
||||||
catch (const RuntimeError &err)
|
catch (const RuntimeError &)
|
||||||
{
|
{
|
||||||
db.rollback();
|
db.rollback();
|
||||||
throw;
|
throw;
|
||||||
|
@ -354,6 +354,7 @@ Session::Session(QObject *parent)
|
|||||||
, m_sendBufferWatermark(BITTORRENT_SESSION_KEY("SendBufferWatermark"), 500)
|
, m_sendBufferWatermark(BITTORRENT_SESSION_KEY("SendBufferWatermark"), 500)
|
||||||
, m_sendBufferLowWatermark(BITTORRENT_SESSION_KEY("SendBufferLowWatermark"), 10)
|
, m_sendBufferLowWatermark(BITTORRENT_SESSION_KEY("SendBufferLowWatermark"), 10)
|
||||||
, m_sendBufferWatermarkFactor(BITTORRENT_SESSION_KEY("SendBufferWatermarkFactor"), 50)
|
, m_sendBufferWatermarkFactor(BITTORRENT_SESSION_KEY("SendBufferWatermarkFactor"), 50)
|
||||||
|
, m_connectionSpeed(BITTORRENT_SESSION_KEY("ConnectionSpeed"), 30)
|
||||||
, m_socketBacklogSize(BITTORRENT_SESSION_KEY("SocketBacklogSize"), 30)
|
, m_socketBacklogSize(BITTORRENT_SESSION_KEY("SocketBacklogSize"), 30)
|
||||||
, m_isAnonymousModeEnabled(BITTORRENT_SESSION_KEY("AnonymousModeEnabled"), false)
|
, m_isAnonymousModeEnabled(BITTORRENT_SESSION_KEY("AnonymousModeEnabled"), false)
|
||||||
, m_isQueueingEnabled(BITTORRENT_SESSION_KEY("QueueingSystemEnabled"), false)
|
, m_isQueueingEnabled(BITTORRENT_SESSION_KEY("QueueingSystemEnabled"), false)
|
||||||
@ -1073,7 +1074,6 @@ void Session::initializeNativeSession()
|
|||||||
// Speed up exit
|
// Speed up exit
|
||||||
pack.set_int(lt::settings_pack::auto_scrape_interval, 1200); // 20 minutes
|
pack.set_int(lt::settings_pack::auto_scrape_interval, 1200); // 20 minutes
|
||||||
pack.set_int(lt::settings_pack::auto_scrape_min_interval, 900); // 15 minutes
|
pack.set_int(lt::settings_pack::auto_scrape_min_interval, 900); // 15 minutes
|
||||||
pack.set_int(lt::settings_pack::connection_speed, 20); // default is 10
|
|
||||||
// libtorrent 1.1 enables UPnP & NAT-PMP by default
|
// libtorrent 1.1 enables UPnP & NAT-PMP by default
|
||||||
// turn them off before `lt::session` ctor to avoid split second effects
|
// turn them off before `lt::session` ctor to avoid split second effects
|
||||||
pack.set_bool(lt::settings_pack::enable_upnp, false);
|
pack.set_bool(lt::settings_pack::enable_upnp, false);
|
||||||
@ -1190,6 +1190,8 @@ void Session::initMetrics()
|
|||||||
|
|
||||||
void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
||||||
{
|
{
|
||||||
|
settingsPack.set_int(lt::settings_pack::connection_speed, connectionSpeed());
|
||||||
|
|
||||||
// from libtorrent doc:
|
// from libtorrent doc:
|
||||||
// It will not take affect until the listen_interfaces settings is updated
|
// It will not take affect until the listen_interfaces settings is updated
|
||||||
settingsPack.set_int(lt::settings_pack::listen_queue_size, socketBacklogSize());
|
settingsPack.set_int(lt::settings_pack::listen_queue_size, socketBacklogSize());
|
||||||
@ -3330,6 +3332,19 @@ void Session::setSendBufferWatermarkFactor(const int value)
|
|||||||
configureDeferred();
|
configureDeferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Session::connectionSpeed() const
|
||||||
|
{
|
||||||
|
return m_connectionSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Session::setConnectionSpeed(const int value)
|
||||||
|
{
|
||||||
|
if (value == m_connectionSpeed) return;
|
||||||
|
|
||||||
|
m_connectionSpeed = value;
|
||||||
|
configureDeferred();
|
||||||
|
}
|
||||||
|
|
||||||
int Session::socketBacklogSize() const
|
int Session::socketBacklogSize() const
|
||||||
{
|
{
|
||||||
return m_socketBacklogSize;
|
return m_socketBacklogSize;
|
||||||
|
@ -372,6 +372,8 @@ namespace BitTorrent
|
|||||||
void setSendBufferLowWatermark(int value);
|
void setSendBufferLowWatermark(int value);
|
||||||
int sendBufferWatermarkFactor() const;
|
int sendBufferWatermarkFactor() const;
|
||||||
void setSendBufferWatermarkFactor(int value);
|
void setSendBufferWatermarkFactor(int value);
|
||||||
|
int connectionSpeed() const;
|
||||||
|
void setConnectionSpeed(int value);
|
||||||
int socketBacklogSize() const;
|
int socketBacklogSize() const;
|
||||||
void setSocketBacklogSize(int value);
|
void setSocketBacklogSize(int value);
|
||||||
bool isAnonymousModeEnabled() const;
|
bool isAnonymousModeEnabled() const;
|
||||||
@ -675,6 +677,7 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<int> m_sendBufferWatermark;
|
CachedSettingValue<int> m_sendBufferWatermark;
|
||||||
CachedSettingValue<int> m_sendBufferLowWatermark;
|
CachedSettingValue<int> m_sendBufferLowWatermark;
|
||||||
CachedSettingValue<int> m_sendBufferWatermarkFactor;
|
CachedSettingValue<int> m_sendBufferWatermarkFactor;
|
||||||
|
CachedSettingValue<int> m_connectionSpeed;
|
||||||
CachedSettingValue<int> m_socketBacklogSize;
|
CachedSettingValue<int> m_socketBacklogSize;
|
||||||
CachedSettingValue<bool> m_isAnonymousModeEnabled;
|
CachedSettingValue<bool> m_isAnonymousModeEnabled;
|
||||||
CachedSettingValue<bool> m_isQueueingEnabled;
|
CachedSettingValue<bool> m_isQueueingEnabled;
|
||||||
|
@ -35,43 +35,43 @@
|
|||||||
|
|
||||||
namespace Http
|
namespace Http
|
||||||
{
|
{
|
||||||
const char METHOD_GET[] = "GET";
|
inline const char METHOD_GET[] = "GET";
|
||||||
const char METHOD_POST[] = "POST";
|
inline const char METHOD_POST[] = "POST";
|
||||||
|
|
||||||
const char HEADER_CACHE_CONTROL[] = "cache-control";
|
inline const char HEADER_CACHE_CONTROL[] = "cache-control";
|
||||||
const char HEADER_CONNECTION[] = "connection";
|
inline const char HEADER_CONNECTION[] = "connection";
|
||||||
const char HEADER_CONTENT_DISPOSITION[] = "content-disposition";
|
inline const char HEADER_CONTENT_DISPOSITION[] = "content-disposition";
|
||||||
const char HEADER_CONTENT_ENCODING[] = "content-encoding";
|
inline const char HEADER_CONTENT_ENCODING[] = "content-encoding";
|
||||||
const char HEADER_CONTENT_LENGTH[] = "content-length";
|
inline const char HEADER_CONTENT_LENGTH[] = "content-length";
|
||||||
const char HEADER_CONTENT_SECURITY_POLICY[] = "content-security-policy";
|
inline const char HEADER_CONTENT_SECURITY_POLICY[] = "content-security-policy";
|
||||||
const char HEADER_CONTENT_TYPE[] = "content-type";
|
inline const char HEADER_CONTENT_TYPE[] = "content-type";
|
||||||
const char HEADER_DATE[] = "date";
|
inline const char HEADER_DATE[] = "date";
|
||||||
const char HEADER_HOST[] = "host";
|
inline const char HEADER_HOST[] = "host";
|
||||||
const char HEADER_ORIGIN[] = "origin";
|
inline const char HEADER_ORIGIN[] = "origin";
|
||||||
const char HEADER_REFERER[] = "referer";
|
inline const char HEADER_REFERER[] = "referer";
|
||||||
const char HEADER_REFERRER_POLICY[] = "referrer-policy";
|
inline const char HEADER_REFERRER_POLICY[] = "referrer-policy";
|
||||||
const char HEADER_SET_COOKIE[] = "set-cookie";
|
inline const char HEADER_SET_COOKIE[] = "set-cookie";
|
||||||
const char HEADER_X_CONTENT_TYPE_OPTIONS[] = "x-content-type-options";
|
inline const char HEADER_X_CONTENT_TYPE_OPTIONS[] = "x-content-type-options";
|
||||||
const char HEADER_X_FORWARDED_HOST[] = "x-forwarded-host";
|
inline const char HEADER_X_FORWARDED_HOST[] = "x-forwarded-host";
|
||||||
const char HEADER_X_FRAME_OPTIONS[] = "x-frame-options";
|
inline const char HEADER_X_FRAME_OPTIONS[] = "x-frame-options";
|
||||||
const char HEADER_X_XSS_PROTECTION[] = "x-xss-protection";
|
inline const char HEADER_X_XSS_PROTECTION[] = "x-xss-protection";
|
||||||
|
|
||||||
const char HEADER_REQUEST_METHOD_GET[] = "GET";
|
inline const char HEADER_REQUEST_METHOD_GET[] = "GET";
|
||||||
const char HEADER_REQUEST_METHOD_HEAD[] = "HEAD";
|
inline const char HEADER_REQUEST_METHOD_HEAD[] = "HEAD";
|
||||||
const char HEADER_REQUEST_METHOD_POST[] = "POST";
|
inline const char HEADER_REQUEST_METHOD_POST[] = "POST";
|
||||||
|
|
||||||
const char CONTENT_TYPE_HTML[] = "text/html";
|
inline const char CONTENT_TYPE_HTML[] = "text/html";
|
||||||
const char CONTENT_TYPE_CSS[] = "text/css";
|
inline const char CONTENT_TYPE_CSS[] = "text/css";
|
||||||
const char CONTENT_TYPE_TXT[] = "text/plain; charset=UTF-8";
|
inline const char CONTENT_TYPE_TXT[] = "text/plain; charset=UTF-8";
|
||||||
const char CONTENT_TYPE_JS[] = "application/javascript";
|
inline const char CONTENT_TYPE_JS[] = "application/javascript";
|
||||||
const char CONTENT_TYPE_JSON[] = "application/json";
|
inline const char CONTENT_TYPE_JSON[] = "application/json";
|
||||||
const char CONTENT_TYPE_GIF[] = "image/gif";
|
inline const char CONTENT_TYPE_GIF[] = "image/gif";
|
||||||
const char CONTENT_TYPE_PNG[] = "image/png";
|
inline const char CONTENT_TYPE_PNG[] = "image/png";
|
||||||
const char CONTENT_TYPE_FORM_ENCODED[] = "application/x-www-form-urlencoded";
|
inline const char CONTENT_TYPE_FORM_ENCODED[] = "application/x-www-form-urlencoded";
|
||||||
const char CONTENT_TYPE_FORM_DATA[] = "multipart/form-data";
|
inline const char CONTENT_TYPE_FORM_DATA[] = "multipart/form-data";
|
||||||
|
|
||||||
// portability: "\r\n" doesn't guarantee mapping to the correct symbol
|
// portability: "\r\n" doesn't guarantee mapping to the correct symbol
|
||||||
const char CRLF[] = {0x0D, 0x0A, '\0'};
|
inline const char CRLF[] = {0x0D, 0x0A, '\0'};
|
||||||
|
|
||||||
struct Environment
|
struct Environment
|
||||||
{
|
{
|
||||||
@ -120,7 +120,7 @@ namespace Http
|
|||||||
HeaderMap headers;
|
HeaderMap headers;
|
||||||
QByteArray content;
|
QByteArray content;
|
||||||
|
|
||||||
Response(uint code = 200, const QString &text = "OK")
|
Response(uint code = 200, const QString &text = QLatin1String("OK"))
|
||||||
: status {code, text}
|
: status {code, text}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,7 @@ namespace
|
|||||||
SEND_BUF_LOW_WATERMARK,
|
SEND_BUF_LOW_WATERMARK,
|
||||||
SEND_BUF_WATERMARK_FACTOR,
|
SEND_BUF_WATERMARK_FACTOR,
|
||||||
// networking & ports
|
// networking & ports
|
||||||
|
CONNECTION_SPEED,
|
||||||
SOCKET_BACKLOG_SIZE,
|
SOCKET_BACKLOG_SIZE,
|
||||||
OUTGOING_PORT_MIN,
|
OUTGOING_PORT_MIN,
|
||||||
OUTGOING_PORT_MAX,
|
OUTGOING_PORT_MAX,
|
||||||
@ -224,6 +225,8 @@ void AdvancedSettings::saveAdvancedSettings()
|
|||||||
session->setSendBufferWatermark(m_spinBoxSendBufferWatermark.value());
|
session->setSendBufferWatermark(m_spinBoxSendBufferWatermark.value());
|
||||||
session->setSendBufferLowWatermark(m_spinBoxSendBufferLowWatermark.value());
|
session->setSendBufferLowWatermark(m_spinBoxSendBufferLowWatermark.value());
|
||||||
session->setSendBufferWatermarkFactor(m_spinBoxSendBufferWatermarkFactor.value());
|
session->setSendBufferWatermarkFactor(m_spinBoxSendBufferWatermarkFactor.value());
|
||||||
|
// Outgoing connections per second
|
||||||
|
session->setConnectionSpeed(m_spinBoxConnectionSpeed.value());
|
||||||
// Socket listen backlog size
|
// Socket listen backlog size
|
||||||
session->setSocketBacklogSize(m_spinBoxSocketBacklogSize.value());
|
session->setSocketBacklogSize(m_spinBoxSocketBacklogSize.value());
|
||||||
// Save resume data interval
|
// Save resume data interval
|
||||||
@ -528,6 +531,12 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||||||
m_spinBoxSendBufferWatermarkFactor.setValue(session->sendBufferWatermarkFactor());
|
m_spinBoxSendBufferWatermarkFactor.setValue(session->sendBufferWatermarkFactor());
|
||||||
addRow(SEND_BUF_WATERMARK_FACTOR, (tr("Send buffer watermark factor") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark_factor", "(?)"))
|
addRow(SEND_BUF_WATERMARK_FACTOR, (tr("Send buffer watermark factor") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark_factor", "(?)"))
|
||||||
, &m_spinBoxSendBufferWatermarkFactor);
|
, &m_spinBoxSendBufferWatermarkFactor);
|
||||||
|
// Outgoing connections per second
|
||||||
|
m_spinBoxConnectionSpeed.setMinimum(0);
|
||||||
|
m_spinBoxConnectionSpeed.setMaximum(std::numeric_limits<int>::max());
|
||||||
|
m_spinBoxConnectionSpeed.setValue(session->connectionSpeed());
|
||||||
|
addRow(CONNECTION_SPEED, (tr("Outgoing connections per second") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#connection_speed", "(?)"))
|
||||||
|
, &m_spinBoxConnectionSpeed);
|
||||||
// Socket listen backlog size
|
// Socket listen backlog size
|
||||||
m_spinBoxSocketBacklogSize.setMinimum(1);
|
m_spinBoxSocketBacklogSize.setMinimum(1);
|
||||||
m_spinBoxSocketBacklogSize.setMaximum(std::numeric_limits<int>::max());
|
m_spinBoxSocketBacklogSize.setMaximum(std::numeric_limits<int>::max());
|
||||||
|
@ -63,7 +63,7 @@ private:
|
|||||||
QSpinBox m_spinBoxAsyncIOThreads, m_spinBoxFilePoolSize, m_spinBoxCheckingMemUsage,
|
QSpinBox m_spinBoxAsyncIOThreads, m_spinBoxFilePoolSize, m_spinBoxCheckingMemUsage,
|
||||||
m_spinBoxSaveResumeDataInterval, m_spinBoxOutgoingPortsMin, m_spinBoxOutgoingPortsMax, m_spinBoxUPnPLeaseDuration, m_spinBoxPeerToS,
|
m_spinBoxSaveResumeDataInterval, m_spinBoxOutgoingPortsMin, m_spinBoxOutgoingPortsMax, m_spinBoxUPnPLeaseDuration, m_spinBoxPeerToS,
|
||||||
m_spinBoxListRefresh, m_spinBoxTrackerPort, m_spinBoxSendBufferWatermark, m_spinBoxSendBufferLowWatermark,
|
m_spinBoxListRefresh, m_spinBoxTrackerPort, m_spinBoxSendBufferWatermark, m_spinBoxSendBufferLowWatermark,
|
||||||
m_spinBoxSendBufferWatermarkFactor, m_spinBoxSocketBacklogSize, m_spinBoxMaxConcurrentHTTPAnnounces, m_spinBoxStopTrackerTimeout,
|
m_spinBoxSendBufferWatermarkFactor, m_spinBoxConnectionSpeed, m_spinBoxSocketBacklogSize, m_spinBoxMaxConcurrentHTTPAnnounces, m_spinBoxStopTrackerTimeout,
|
||||||
m_spinBoxSavePathHistoryLength, m_spinBoxPeerTurnover, m_spinBoxPeerTurnoverCutoff, m_spinBoxPeerTurnoverInterval;
|
m_spinBoxSavePathHistoryLength, m_spinBoxPeerTurnover, m_spinBoxPeerTurnoverCutoff, m_spinBoxPeerTurnoverInterval;
|
||||||
QCheckBox m_checkBoxOsCache, m_checkBoxRecheckCompleted, m_checkBoxResolveCountries, m_checkBoxResolveHosts,
|
QCheckBox m_checkBoxOsCache, m_checkBoxRecheckCompleted, m_checkBoxResolveCountries, m_checkBoxResolveHosts,
|
||||||
m_checkBoxProgramNotifications, m_checkBoxTorrentAddedNotifications, m_checkBoxReannounceWhenAddressChanged, m_checkBoxTrackerFavicon, m_checkBoxTrackerStatus,
|
m_checkBoxProgramNotifications, m_checkBoxTorrentAddedNotifications, m_checkBoxReannounceWhenAddressChanged, m_checkBoxTrackerFavicon, m_checkBoxTrackerStatus,
|
||||||
|
@ -313,6 +313,8 @@ void AppController::preferencesAction()
|
|||||||
data["send_buffer_watermark"] = session->sendBufferWatermark();
|
data["send_buffer_watermark"] = session->sendBufferWatermark();
|
||||||
data["send_buffer_low_watermark"] = session->sendBufferLowWatermark();
|
data["send_buffer_low_watermark"] = session->sendBufferLowWatermark();
|
||||||
data["send_buffer_watermark_factor"] = session->sendBufferWatermarkFactor();
|
data["send_buffer_watermark_factor"] = session->sendBufferWatermarkFactor();
|
||||||
|
// Outgoing connections per second
|
||||||
|
data["connection_speed"] = session->connectionSpeed();
|
||||||
// Socket listen backlog size
|
// Socket listen backlog size
|
||||||
data["socket_backlog_size"] = session->socketBacklogSize();
|
data["socket_backlog_size"] = session->socketBacklogSize();
|
||||||
// Outgoing ports
|
// Outgoing ports
|
||||||
@ -776,6 +778,9 @@ void AppController::setPreferencesAction()
|
|||||||
session->setSendBufferLowWatermark(it.value().toInt());
|
session->setSendBufferLowWatermark(it.value().toInt());
|
||||||
if (hasKey("send_buffer_watermark_factor"))
|
if (hasKey("send_buffer_watermark_factor"))
|
||||||
session->setSendBufferWatermarkFactor(it.value().toInt());
|
session->setSendBufferWatermarkFactor(it.value().toInt());
|
||||||
|
// Outgoing connections per second
|
||||||
|
if (hasKey("connection_speed"))
|
||||||
|
session->setConnectionSpeed(it.value().toInt());
|
||||||
// Socket listen backlog size
|
// Socket listen backlog size
|
||||||
if (hasKey("socket_backlog_size"))
|
if (hasKey("socket_backlog_size"))
|
||||||
session->setSocketBacklogSize(it.value().toInt());
|
session->setSocketBacklogSize(it.value().toInt());
|
||||||
|
@ -36,51 +36,51 @@ namespace BitTorrent
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Torrent keys
|
// Torrent keys
|
||||||
const char KEY_TORRENT_ID[] = "hash";
|
inline const char KEY_TORRENT_ID[] = "hash";
|
||||||
const char KEY_TORRENT_NAME[] = "name";
|
inline const char KEY_TORRENT_NAME[] = "name";
|
||||||
const char KEY_TORRENT_MAGNET_URI[] = "magnet_uri";
|
inline const char KEY_TORRENT_MAGNET_URI[] = "magnet_uri";
|
||||||
const char KEY_TORRENT_SIZE[] = "size";
|
inline const char KEY_TORRENT_SIZE[] = "size";
|
||||||
const char KEY_TORRENT_PROGRESS[] = "progress";
|
inline const char KEY_TORRENT_PROGRESS[] = "progress";
|
||||||
const char KEY_TORRENT_DLSPEED[] = "dlspeed";
|
inline const char KEY_TORRENT_DLSPEED[] = "dlspeed";
|
||||||
const char KEY_TORRENT_UPSPEED[] = "upspeed";
|
inline const char KEY_TORRENT_UPSPEED[] = "upspeed";
|
||||||
const char KEY_TORRENT_QUEUE_POSITION[] = "priority";
|
inline const char KEY_TORRENT_QUEUE_POSITION[] = "priority";
|
||||||
const char KEY_TORRENT_SEEDS[] = "num_seeds";
|
inline const char KEY_TORRENT_SEEDS[] = "num_seeds";
|
||||||
const char KEY_TORRENT_NUM_COMPLETE[] = "num_complete";
|
inline const char KEY_TORRENT_NUM_COMPLETE[] = "num_complete";
|
||||||
const char KEY_TORRENT_LEECHS[] = "num_leechs";
|
inline const char KEY_TORRENT_LEECHS[] = "num_leechs";
|
||||||
const char KEY_TORRENT_NUM_INCOMPLETE[] = "num_incomplete";
|
inline const char KEY_TORRENT_NUM_INCOMPLETE[] = "num_incomplete";
|
||||||
const char KEY_TORRENT_RATIO[] = "ratio";
|
inline const char KEY_TORRENT_RATIO[] = "ratio";
|
||||||
const char KEY_TORRENT_ETA[] = "eta";
|
inline const char KEY_TORRENT_ETA[] = "eta";
|
||||||
const char KEY_TORRENT_STATE[] = "state";
|
inline const char KEY_TORRENT_STATE[] = "state";
|
||||||
const char KEY_TORRENT_SEQUENTIAL_DOWNLOAD[] = "seq_dl";
|
inline const char KEY_TORRENT_SEQUENTIAL_DOWNLOAD[] = "seq_dl";
|
||||||
const char KEY_TORRENT_FIRST_LAST_PIECE_PRIO[] = "f_l_piece_prio";
|
inline const char KEY_TORRENT_FIRST_LAST_PIECE_PRIO[] = "f_l_piece_prio";
|
||||||
const char KEY_TORRENT_CATEGORY[] = "category";
|
inline const char KEY_TORRENT_CATEGORY[] = "category";
|
||||||
const char KEY_TORRENT_TAGS[] = "tags";
|
inline const char KEY_TORRENT_TAGS[] = "tags";
|
||||||
const char KEY_TORRENT_SUPER_SEEDING[] = "super_seeding";
|
inline const char KEY_TORRENT_SUPER_SEEDING[] = "super_seeding";
|
||||||
const char KEY_TORRENT_FORCE_START[] = "force_start";
|
inline const char KEY_TORRENT_FORCE_START[] = "force_start";
|
||||||
const char KEY_TORRENT_SAVE_PATH[] = "save_path";
|
inline const char KEY_TORRENT_SAVE_PATH[] = "save_path";
|
||||||
const char KEY_TORRENT_CONTENT_PATH[] = "content_path";
|
inline const char KEY_TORRENT_CONTENT_PATH[] = "content_path";
|
||||||
const char KEY_TORRENT_ADDED_ON[] = "added_on";
|
inline const char KEY_TORRENT_ADDED_ON[] = "added_on";
|
||||||
const char KEY_TORRENT_COMPLETION_ON[] = "completion_on";
|
inline const char KEY_TORRENT_COMPLETION_ON[] = "completion_on";
|
||||||
const char KEY_TORRENT_TRACKER[] = "tracker";
|
inline const char KEY_TORRENT_TRACKER[] = "tracker";
|
||||||
const char KEY_TORRENT_TRACKERS_COUNT[] = "trackers_count";
|
inline const char KEY_TORRENT_TRACKERS_COUNT[] = "trackers_count";
|
||||||
const char KEY_TORRENT_DL_LIMIT[] = "dl_limit";
|
inline const char KEY_TORRENT_DL_LIMIT[] = "dl_limit";
|
||||||
const char KEY_TORRENT_UP_LIMIT[] = "up_limit";
|
inline const char KEY_TORRENT_UP_LIMIT[] = "up_limit";
|
||||||
const char KEY_TORRENT_AMOUNT_DOWNLOADED[] = "downloaded";
|
inline const char KEY_TORRENT_AMOUNT_DOWNLOADED[] = "downloaded";
|
||||||
const char KEY_TORRENT_AMOUNT_UPLOADED[] = "uploaded";
|
inline const char KEY_TORRENT_AMOUNT_UPLOADED[] = "uploaded";
|
||||||
const char KEY_TORRENT_AMOUNT_DOWNLOADED_SESSION[] = "downloaded_session";
|
inline const char KEY_TORRENT_AMOUNT_DOWNLOADED_SESSION[] = "downloaded_session";
|
||||||
const char KEY_TORRENT_AMOUNT_UPLOADED_SESSION[] = "uploaded_session";
|
inline const char KEY_TORRENT_AMOUNT_UPLOADED_SESSION[] = "uploaded_session";
|
||||||
const char KEY_TORRENT_AMOUNT_LEFT[] = "amount_left";
|
inline const char KEY_TORRENT_AMOUNT_LEFT[] = "amount_left";
|
||||||
const char KEY_TORRENT_AMOUNT_COMPLETED[] = "completed";
|
inline const char KEY_TORRENT_AMOUNT_COMPLETED[] = "completed";
|
||||||
const char KEY_TORRENT_MAX_RATIO[] = "max_ratio";
|
inline const char KEY_TORRENT_MAX_RATIO[] = "max_ratio";
|
||||||
const char KEY_TORRENT_MAX_SEEDING_TIME[] = "max_seeding_time";
|
inline const char KEY_TORRENT_MAX_SEEDING_TIME[] = "max_seeding_time";
|
||||||
const char KEY_TORRENT_RATIO_LIMIT[] = "ratio_limit";
|
inline const char KEY_TORRENT_RATIO_LIMIT[] = "ratio_limit";
|
||||||
const char KEY_TORRENT_SEEDING_TIME_LIMIT[] = "seeding_time_limit";
|
inline const char KEY_TORRENT_SEEDING_TIME_LIMIT[] = "seeding_time_limit";
|
||||||
const char KEY_TORRENT_LAST_SEEN_COMPLETE_TIME[] = "seen_complete";
|
inline const char KEY_TORRENT_LAST_SEEN_COMPLETE_TIME[] = "seen_complete";
|
||||||
const char KEY_TORRENT_LAST_ACTIVITY_TIME[] = "last_activity";
|
inline const char KEY_TORRENT_LAST_ACTIVITY_TIME[] = "last_activity";
|
||||||
const char KEY_TORRENT_TOTAL_SIZE[] = "total_size";
|
inline const char KEY_TORRENT_TOTAL_SIZE[] = "total_size";
|
||||||
const char KEY_TORRENT_AUTO_TORRENT_MANAGEMENT[] = "auto_tmm";
|
inline const char KEY_TORRENT_AUTO_TORRENT_MANAGEMENT[] = "auto_tmm";
|
||||||
const char KEY_TORRENT_TIME_ACTIVE[] = "time_active";
|
inline const char KEY_TORRENT_TIME_ACTIVE[] = "time_active";
|
||||||
const char KEY_TORRENT_SEEDING_TIME[] = "seeding_time";
|
inline const char KEY_TORRENT_SEEDING_TIME[] = "seeding_time";
|
||||||
const char KEY_TORRENT_AVAILABILITY[] = "availability";
|
inline const char KEY_TORRENT_AVAILABILITY[] = "availability";
|
||||||
|
|
||||||
QVariantMap serialize(const BitTorrent::Torrent &torrent);
|
QVariantMap serialize(const BitTorrent::Torrent &torrent);
|
||||||
|
@ -62,7 +62,8 @@
|
|||||||
#include "api/torrentscontroller.h"
|
#include "api/torrentscontroller.h"
|
||||||
#include "api/transfercontroller.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 PATH_PREFIX_ICONS {QStringLiteral("/icons/")};
|
||||||
const QString WWW_FOLDER {QStringLiteral(":/www")};
|
const QString WWW_FOLDER {QStringLiteral(":/www")};
|
||||||
|
@ -43,13 +43,11 @@
|
|||||||
#include "base/utils/net.h"
|
#include "base/utils/net.h"
|
||||||
#include "base/utils/version.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 APIController;
|
||||||
class WebApplication;
|
class WebApplication;
|
||||||
|
|
||||||
constexpr char C_SID[] = "SID"; // name of session id cookie
|
|
||||||
|
|
||||||
class WebSession final : public ISession
|
class WebSession final : public ISession
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -1055,6 +1055,14 @@
|
|||||||
<input type="text" id="sendBufferWatermarkFactor" style="width: 15em;" /> %
|
<input type="text" id="sendBufferWatermarkFactor" style="width: 15em;" /> %
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td>
|
<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>
|
<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>
|
||||||
@ -1905,6 +1913,7 @@
|
|||||||
$('sendBufferWatermark').setProperty('value', pref.send_buffer_watermark);
|
$('sendBufferWatermark').setProperty('value', pref.send_buffer_watermark);
|
||||||
$('sendBufferLowWatermark').setProperty('value', pref.send_buffer_low_watermark);
|
$('sendBufferLowWatermark').setProperty('value', pref.send_buffer_low_watermark);
|
||||||
$('sendBufferWatermarkFactor').setProperty('value', pref.send_buffer_watermark_factor);
|
$('sendBufferWatermarkFactor').setProperty('value', pref.send_buffer_watermark_factor);
|
||||||
|
$('connectionSpeed').setProperty('value', pref.connection_speed);
|
||||||
$('socketBacklogSize').setProperty('value', pref.socket_backlog_size);
|
$('socketBacklogSize').setProperty('value', pref.socket_backlog_size);
|
||||||
$('outgoingPortsMin').setProperty('value', pref.outgoing_ports_min);
|
$('outgoingPortsMin').setProperty('value', pref.outgoing_ports_min);
|
||||||
$('outgoingPortsMax').setProperty('value', pref.outgoing_ports_max);
|
$('outgoingPortsMax').setProperty('value', pref.outgoing_ports_max);
|
||||||
@ -2295,6 +2304,7 @@
|
|||||||
settings.set('send_buffer_watermark', $('sendBufferWatermark').getProperty('value'));
|
settings.set('send_buffer_watermark', $('sendBufferWatermark').getProperty('value'));
|
||||||
settings.set('send_buffer_low_watermark', $('sendBufferLowWatermark').getProperty('value'));
|
settings.set('send_buffer_low_watermark', $('sendBufferLowWatermark').getProperty('value'));
|
||||||
settings.set('send_buffer_watermark_factor', $('sendBufferWatermarkFactor').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('socket_backlog_size', $('socketBacklogSize').getProperty('value'));
|
||||||
settings.set('outgoing_ports_min', $('outgoingPortsMin').getProperty('value'));
|
settings.set('outgoing_ports_min', $('outgoingPortsMin').getProperty('value'));
|
||||||
settings.set('outgoing_ports_max', $('outgoingPortsMax').getProperty('value'));
|
settings.set('outgoing_ports_max', $('outgoingPortsMax').getProperty('value'));
|
||||||
|
Loading…
Reference in New Issue
Block a user