diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 648f165f0..35fa11b73 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1602,9 +1602,9 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { } } - // Set DHT port (>= 1000 or 0 if same as BT) + // Set DHT port (>= 1 or 0 if same as BT) void Bittorrent::setDHTPort(int dht_port) { - if(dht_port == 0 || dht_port >= 1000) { + if(dht_port >= 0) { if(dht_port == current_dht_port) return; struct dht_settings DHTSettings; DHTSettings.service_port = dht_port; diff --git a/src/main.cpp b/src/main.cpp index 5a2e45559..28869f6f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -225,7 +225,7 @@ int main(int argc, char *argv[]){ if(parts.size() == 2) { bool ok = false; int new_port = parts.last().toInt(&ok); - if(ok && new_port > 1024 && new_port <= 65535) { + if(ok && new_port > 0 && new_port <= 65535) { Preferences::setWebUiPort(new_port); } } diff --git a/src/preferences.h b/src/preferences.h index bb89c46c0..d632e4c00 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -545,7 +545,7 @@ public: static int getDHTPort() { QSettings settings("qBittorrent", "qBittorrent"); - return settings.value(QString::fromUtf8("Preferences/Bittorrent/DHTPort"), 6882).toInt(); + return settings.value(QString::fromUtf8("Preferences/Bittorrent/DHTPort"), 6881).toInt(); } static bool isLSDEnabled() { diff --git a/src/ui/options.ui b/src/ui/options.ui index 082dde196..e67dbd370 100644 --- a/src/ui/options.ui +++ b/src/ui/options.ui @@ -1138,7 +1138,7 @@ QGroupBox { - 1000 + 1 65535 @@ -1520,7 +1520,7 @@ QGroupBox { 0 0 620 - 495 + 490 @@ -1584,13 +1584,13 @@ QGroupBox { false - 1024 + 1 65525 - 6882 + 6881 @@ -1937,7 +1937,7 @@ QGroupBox { 0 0 620 - 495 + 490 @@ -2016,6 +2016,9 @@ QGroupBox { false + + 1 + 65535 @@ -2216,6 +2219,9 @@ QGroupBox { false + + 1 + 65535 @@ -2365,7 +2371,7 @@ QGroupBox { 0 0 620 - 495 + 490 @@ -2462,7 +2468,7 @@ QGroupBox { 0 0 620 - 495 + 490 @@ -2497,11 +2503,14 @@ QGroupBox { + + 1 + 65535 - 80 + 8080 @@ -2626,7 +2635,7 @@ QGroupBox { 0 0 620 - 495 + 490