1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-23 04:54:18 +00:00

Don't trip on absence of global ratio in QBtSession::processBigRatios()

QBtSession::processBigRatios() must fetch the global ratio, if
applicable, before checking for NO_RATIO_LIMIT.

LP: #835217
This commit is contained in:
Frédéric Brière 2012-05-27 11:46:00 -04:00 committed by Christophe Dumez
parent 901326c004
commit 91af418254

View File

@ -272,10 +272,10 @@ void QBtSession::processBigRatios() {
const QString hash = h.hash(); const QString hash = h.hash();
const qreal ratio = getRealRatio(hash); const qreal ratio = getRealRatio(hash);
qreal ratio_limit = TorrentPersistentData::getRatioLimit(hash); qreal ratio_limit = TorrentPersistentData::getRatioLimit(hash);
if (ratio_limit == TorrentPersistentData::NO_RATIO_LIMIT)
continue;
if (ratio_limit == TorrentPersistentData::USE_GLOBAL_RATIO) if (ratio_limit == TorrentPersistentData::USE_GLOBAL_RATIO)
ratio_limit = global_ratio_limit; ratio_limit = global_ratio_limit;
if (ratio_limit == TorrentPersistentData::NO_RATIO_LIMIT)
continue;
qDebug("Ratio: %f (limit: %f)", ratio, ratio_limit); qDebug("Ratio: %f (limit: %f)", ratio, ratio_limit);
Q_ASSERT(ratio_limit >= 0.f); Q_ASSERT(ratio_limit >= 0.f);
if (ratio <= MAX_RATIO && ratio >= ratio_limit) { if (ratio <= MAX_RATIO && ratio >= ratio_limit) {