mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
- 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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user