Browse Source

- qBittorrent can now listen on ports < 1024 (must be root)

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
454c093033
  1. 4
      src/bittorrent.cpp
  2. 2
      src/main.cpp
  3. 2
      src/preferences.h
  4. 27
      src/ui/options.ui

4
src/bittorrent.cpp

@ -1602,9 +1602,9 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { @@ -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;

2
src/main.cpp

@ -225,7 +225,7 @@ int main(int argc, char *argv[]){ @@ -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);
}
}

2
src/preferences.h

@ -545,7 +545,7 @@ public: @@ -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() {

27
src/ui/options.ui

@ -1138,7 +1138,7 @@ QGroupBox { @@ -1138,7 +1138,7 @@ QGroupBox {
<item>
<widget class="QSpinBox" name="spinPort">
<property name="minimum">
<number>1000</number>
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
@ -1520,7 +1520,7 @@ QGroupBox { @@ -1520,7 +1520,7 @@ QGroupBox {
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<height>490</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_20">
@ -1584,13 +1584,13 @@ QGroupBox { @@ -1584,13 +1584,13 @@ QGroupBox {
<bool>false</bool>
</property>
<property name="minimum">
<number>1024</number>
<number>1</number>
</property>
<property name="maximum">
<number>65525</number>
</property>
<property name="value">
<number>6882</number>
<number>6881</number>
</property>
</widget>
</item>
@ -1937,7 +1937,7 @@ QGroupBox { @@ -1937,7 +1937,7 @@ QGroupBox {
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<height>490</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
@ -2016,6 +2016,9 @@ QGroupBox { @@ -2016,6 +2016,9 @@ QGroupBox {
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
@ -2216,6 +2219,9 @@ QGroupBox { @@ -2216,6 +2219,9 @@ QGroupBox {
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
@ -2365,7 +2371,7 @@ QGroupBox { @@ -2365,7 +2371,7 @@ QGroupBox {
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<height>490</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_21">
@ -2462,7 +2468,7 @@ QGroupBox { @@ -2462,7 +2468,7 @@ QGroupBox {
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<height>490</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
@ -2497,11 +2503,14 @@ QGroupBox { @@ -2497,11 +2503,14 @@ QGroupBox {
</item>
<item>
<widget class="QSpinBox" name="spinWebUiPort">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>80</number>
<number>8080</number>
</property>
</widget>
</item>
@ -2626,7 +2635,7 @@ QGroupBox { @@ -2626,7 +2635,7 @@ QGroupBox {
<x>0</x>
<y>0</y>
<width>620</width>
<height>495</height>
<height>490</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_24">

Loading…
Cancel
Save