- BUGFIX: Catching DHT exception in case there is a problem

This commit is contained in:
Christophe Dumez 2007-10-27 20:53:09 +00:00
parent b66be5b64b
commit 8ea34135e4
5 changed files with 23 additions and 12 deletions

View file

@ -884,11 +884,14 @@ void GUI::configureSession(bool deleteOptions) {
BTSession->setMaxUploadsPerTorrent(options->getMaxUploadsPerTorrent());
// * DHT
if(options->isDHTEnabled()) {
BTSession->enableDHT(true);
downloadingTorrentTab->setInfoBar(tr("DHT support [ON], port: %1").arg(new_listenPort), QString::fromUtf8("blue"));
// Set DHT Port
BTSession->setDHTPort(new_listenPort);
}else{
if(BTSession->enableDHT(true)) {
downloadingTorrentTab->setInfoBar(tr("DHT support [ON], port: %1").arg(new_listenPort), QString::fromUtf8("blue"));
} else {
downloadingTorrentTab->setInfoBar(tr("DHT support [OFF]"), QString::fromUtf8("red"));
}
} else {
BTSession->enableDHT(false);
downloadingTorrentTab->setInfoBar(tr("DHT support [OFF]"), QString::fromUtf8("blue"));
}