Browse Source

- Fixed an overflow that could cause ETA to become negative sometimes (hitted an assert)

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
3cb34ed7ee
  1. 2
      TODO
  2. 11
      src/bittorrent.cpp

2
TODO

@ -53,7 +53,6 @@ @@ -53,7 +53,6 @@
* beta 7
- update doc for plugins (and add screenies)
- update doc for options
- See bug about negative ETA
- Translations update (IN PROGRESS)
- Wait that http://pastebin.ca/690649 is fixed
@ -114,6 +113,7 @@ beta6->beta7 changelog: @@ -114,6 +113,7 @@ beta6->beta7 changelog:
- BUGFIX: improved search engine plugin manager code and fixed bugs
- BUGFIX: Dropped Qt4.2 support, becomes too difficult to maintain
- BUGFIX: Fixed deprecation warning with latest libtorrent svn
- BUGFIX: Fixed an overflow causing ETA to become negative sometimes (hitted an assert)
- COSMETIC: Improved some icons
- COSMETIC: Totally redesigned program preferences
- COSMETIC: Improved systray tooltip style

11
src/bittorrent.cpp

@ -160,13 +160,14 @@ void bittorrent::updateETAs() { @@ -160,13 +160,14 @@ void bittorrent::updateETAs() {
unsigned int nbETAs = listEtas.size();
Q_ASSERT(nbETAs);
foreach(val, listEtas) {
// TODO: Remove this debug when #137223 is fixed
qDebug("old moy: %ld", (long)moy);
moy += (qlonglong)((double)val/(double)nbETAs);
qDebug("ETA: %ld, nbETAs: %d, moy: %ld", (long)val, nbETAs, (long)moy);
Q_ASSERT(moy >= 0);
if(moy < 0) break;
}
if(moy < 0) {
ETAs.remove(hash);
} else {
ETAs[hash] = moy;
}
ETAs[hash] = moy;
}
}
}

Loading…
Cancel
Save