mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
- Make sure service port does not change
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.0.4
|
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.0.4
|
||||||
- BUGFIX: Fix PeerGuardian .p2b binary filter support
|
- BUGFIX: Fix PeerGuardian .p2b binary filter support
|
||||||
- BUGFIX: Fix possible crash when closing a search engine tab
|
- BUGFIX: Fix possible crash when closing a search engine tab
|
||||||
|
- BUGFIX: Make sure service port does not change
|
||||||
|
|
||||||
* Wed Dec 23 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.3
|
* Wed Dec 23 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.3
|
||||||
- BUGFIX: Minor cosmetic fix to program preferences
|
- BUGFIX: Minor cosmetic fix to program preferences
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4};
|
enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4};
|
||||||
|
|
||||||
// Main constructor
|
// Main constructor
|
||||||
Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), queueingEnabled(false), geoipDBLoaded(false), exiting(false) {
|
Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), current_dht_port(0), queueingEnabled(false), geoipDBLoaded(false), exiting(false) {
|
||||||
resolve_countries = false;
|
resolve_countries = false;
|
||||||
// To avoid some exceptions
|
// To avoid some exceptions
|
||||||
fs::path::default_name_check(fs::no_check);
|
fs::path::default_name_check(fs::no_check);
|
||||||
@@ -241,10 +241,15 @@ void Bittorrent::configureSession() {
|
|||||||
// Connection
|
// Connection
|
||||||
// * Ports binding
|
// * Ports binding
|
||||||
unsigned short old_listenPort = getListenPort();
|
unsigned short old_listenPort = getListenPort();
|
||||||
setListeningPort(Preferences::getSessionPort());
|
unsigned short new_listenPort;
|
||||||
unsigned short new_listenPort = getListenPort();
|
if(old_listenPort != Preferences::getSessionPort()) {
|
||||||
if(new_listenPort != old_listenPort) {
|
setListeningPort(Preferences::getSessionPort());
|
||||||
addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort)));
|
new_listenPort = getListenPort();
|
||||||
|
if(new_listenPort != old_listenPort) {
|
||||||
|
addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
new_listenPort = old_listenPort;
|
||||||
}
|
}
|
||||||
// * Global download limit
|
// * Global download limit
|
||||||
int down_limit = Preferences::getGlobalDownloadLimit();
|
int down_limit = Preferences::getGlobalDownloadLimit();
|
||||||
@@ -1363,9 +1368,11 @@ void Bittorrent::setDeleteRatio(float ratio) {
|
|||||||
// Set DHT port (>= 1000 or 0 if same as BT)
|
// Set DHT port (>= 1000 or 0 if same as BT)
|
||||||
void Bittorrent::setDHTPort(int dht_port) {
|
void Bittorrent::setDHTPort(int dht_port) {
|
||||||
if(dht_port == 0 || dht_port >= 1000) {
|
if(dht_port == 0 || dht_port >= 1000) {
|
||||||
|
if(dht_port == current_dht_port) return;
|
||||||
struct dht_settings DHTSettings;
|
struct dht_settings DHTSettings;
|
||||||
DHTSettings.service_port = dht_port;
|
DHTSettings.service_port = dht_port;
|
||||||
s->set_dht_settings(DHTSettings);
|
s->set_dht_settings(DHTSettings);
|
||||||
|
current_dht_port = dht_port;
|
||||||
qDebug("Set DHT Port to %d", dht_port);
|
qDebug("Set DHT Port to %d", dht_port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1643,6 +1650,7 @@ QHash<QString, TrackerInfos> Bittorrent::getTrackersInfo(QString hash) const{
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Bittorrent::getListenPort() const{
|
int Bittorrent::getListenPort() const{
|
||||||
|
qDebug("LISTEN PORT: %d", s->listen_port());
|
||||||
return s->listen_port();
|
return s->listen_port();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ private:
|
|||||||
bool NATPMPEnabled;
|
bool NATPMPEnabled;
|
||||||
bool LSDEnabled;
|
bool LSDEnabled;
|
||||||
bool DHTEnabled;
|
bool DHTEnabled;
|
||||||
|
int current_dht_port;
|
||||||
bool queueingEnabled;
|
bool queueingEnabled;
|
||||||
QString defaultSavePath;
|
QString defaultSavePath;
|
||||||
QString defaultTempPath;
|
QString defaultTempPath;
|
||||||
|
|||||||
Reference in New Issue
Block a user