mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
- BUGFIX: Fixed possible overflow in ETA calculation
This commit is contained in:
2
TODO
2
TODO
@@ -61,5 +61,5 @@ rc8->final? changelog:
|
|||||||
- BUGFIX: Do not save fastresume data for checking torrents anymore
|
- BUGFIX: Do not save fastresume data for checking torrents anymore
|
||||||
- BUGFIX: Saving trackers file only when necessary
|
- BUGFIX: Saving trackers file only when necessary
|
||||||
- BUGFIX: Fixed possible segfault when unfiltering files in torrent addition dialog
|
- BUGFIX: Fixed possible segfault when unfiltering files in torrent addition dialog
|
||||||
|
- BUGFIX: Fixed possible overflow in ETA calculation
|
||||||
|
|
||||||
|
|||||||
@@ -166,8 +166,16 @@ void bittorrent::updateETAs() {
|
|||||||
foreach(val, listEtas) {
|
foreach(val, listEtas) {
|
||||||
moy += (qlonglong)((double)val/(double)nbETAs);
|
moy += (qlonglong)((double)val/(double)nbETAs);
|
||||||
}
|
}
|
||||||
Q_ASSERT(moy >= 0);
|
if(moy < 0) {
|
||||||
ETAs[hash] = moy;
|
if(ETAstats.contains(hash)) {
|
||||||
|
ETAstats.remove(hash);
|
||||||
|
}
|
||||||
|
if(ETAs.contains(hash)) {
|
||||||
|
ETAs.remove(hash);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ETAs[hash] = moy;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Speed is too low, we don't want an overflow.
|
// Speed is too low, we don't want an overflow.
|
||||||
if(ETAstats.contains(hash)) {
|
if(ETAstats.contains(hash)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user