mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-05 11:24:15 +00:00
- qBittorrent can now listen on ports < 1024 (must be root)
This commit is contained in:
parent
45eaf7ce58
commit
454c093033
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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 {
|
||||
<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 {
|
||||
<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 {
|
||||
<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 {
|
||||
<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 {
|
||||
<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 {
|
||||
<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 {
|
||||
<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 {
|
||||
</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 {
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>620</width>
|
||||
<height>495</height>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_24">
|
||||
|
Loading…
x
Reference in New Issue
Block a user