- Fix possible issues with DHT service port

This commit is contained in:
Christophe Dumez
2009-12-29 10:13:21 +00:00
parent 93c4b521bb
commit 622d9701cb
3 changed files with 9 additions and 13 deletions

View File

@@ -2,6 +2,7 @@
- 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 - BUGFIX: Make sure service port does not change
- BUGFIX: Fix possible DHT port saving issue
* 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

View File

@@ -241,15 +241,10 @@ void Bittorrent::configureSession() {
// Connection // Connection
// * Ports binding // * Ports binding
unsigned short old_listenPort = getListenPort(); unsigned short old_listenPort = getListenPort();
unsigned short new_listenPort; unsigned short new_listenPort = Preferences::getSessionPort();
if(old_listenPort != Preferences::getSessionPort()) { if(old_listenPort != new_listenPort) {
setListeningPort(Preferences::getSessionPort()); setListeningPort(new_listenPort);
new_listenPort = getListenPort(); addConsoleMessage(tr("qBittorrent is bound to port: TCP/%1", "e.g: qBittorrent is bound to port: 6881").arg( misc::toQString(new_listenPort)));
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();
@@ -351,8 +346,10 @@ void Bittorrent::configureSession() {
if(Preferences::isDHTEnabled()) { if(Preferences::isDHTEnabled()) {
// Set DHT Port // Set DHT Port
if(enableDHT(true)) { if(enableDHT(true)) {
int dht_port = new_listenPort; int dht_port;
if(!Preferences::isDHTPortSameAsBT()) if(Preferences::isDHTPortSameAsBT())
dht_port = 0;
else
dht_port = Preferences::getDHTPort(); dht_port = Preferences::getDHTPort();
setDHTPort(dht_port); setDHTPort(dht_port);
addConsoleMessage(tr("DHT support [ON], port: UDP/%1").arg(dht_port), QString::fromUtf8("blue")); addConsoleMessage(tr("DHT support [ON], port: UDP/%1").arg(dht_port), QString::fromUtf8("blue"));

View File

@@ -868,8 +868,6 @@ bool options_imp::systrayIntegration() const{
} }
int options_imp::getDHTPort() const { int options_imp::getDHTPort() const {
if(isDHTPortSameAsBT())
return 0;
return spinDHTPort->value(); return spinDHTPort->value();
} }