- qBittorrent no longer listens on a random port whenever it receives a listen_f

ailed_alert (because it may correspond to another network interface)
- Display a "disconnected" icon in status bar whenever qBittorrent fails to list
en on the selected port
This commit is contained in:
Christophe Dumez
2009-12-30 16:02:30 +00:00
parent 4941f24fff
commit 7cd2ec57d3
39 changed files with 1095 additions and 1059 deletions

View File

@@ -1516,18 +1516,6 @@ void Bittorrent::readAlerts() {
}
}
}
else if (listen_failed_alert* p = dynamic_cast<listen_failed_alert*>(a.get())) {
// Level: fatal
int tried_port = p->endpoint.port();
srand(time(0));
int fallback_port = tried_port;
do {
fallback_port = rand() % 64512 + 1024;
} while(fallback_port == tried_port);
addConsoleMessage(tr("Couldn't listen on port %1, using %2 instead.").arg(QString::number(tried_port)).arg(QString::number(fallback_port)), QString::fromUtf8("red"));
setListeningPort(fallback_port);
//emit portListeningFailure();
}
/*else if (torrent_paused_alert* p = dynamic_cast<torrent_paused_alert*>(a.get())) {
QTorrentHandle h(p->handle);
qDebug("Received a torrent_paused_alert for %s", h.hash().toLocal8Bit().data());