mirror of https://github.com/aria2/aria2
2009-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that session download length is not updated when PeerStat is not fastest one. * src/SegmentMan.ccpull/1/head
parent
20930f7a7e
commit
de23f72818
|
@ -1,3 +1,9 @@
|
|||
2009-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Fixed the bug that session download length is not updated when
|
||||
PeerStat is not fastest one.
|
||||
* src/SegmentMan.cc
|
||||
|
||||
2009-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Updated doc.
|
||||
|
|
|
@ -314,8 +314,12 @@ void SegmentMan::updateFastestPeerStat(const SharedHandle<PeerStat>& peerStat)
|
|||
if(i == _fastestPeerStats.end()) {
|
||||
_fastestPeerStats.push_back(peerStat);
|
||||
} else if((*i)->getAvgDownloadSpeed() < peerStat->getAvgDownloadSpeed()) {
|
||||
// *i's SessionDownloadLength must be added to peerStat
|
||||
peerStat->addSessionDownloadLength((*i)->getSessionDownloadLength());
|
||||
*i = peerStat;
|
||||
} else {
|
||||
// peerStat's SessionDownloadLength must be added to *i
|
||||
(*i)->addSessionDownloadLength(peerStat->getSessionDownloadLength());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue