Randomize the listening port only on startup.

This commit is contained in:
sledgehammer999
2015-02-23 19:34:53 +02:00
parent 2c90ded9aa
commit 153f3328f3
3 changed files with 5 additions and 4 deletions

View File

@@ -309,9 +309,6 @@ void QBtSession::setQueueingEnabled(bool enable) {
void QBtSession::configureSession() {
qDebug("Configuring session");
Preferences* const pref = Preferences::instance();
if (pref->useRandomPort()) {
pref->setSessionPort(rand() % USHRT_MAX + 1025);
}
const unsigned short old_listenPort = getListenPort();
const unsigned short new_listenPort = pref->getSessionPort();