summaryrefslogtreecommitdiff
path: root/src/TorrentMan.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-06-24 17:26:59 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-06-24 17:26:59 +0000
commit5b2c2e626bfe0108d2a8adb01cde16540de696b9 (patch)
treef1b0c17a1e791701f9414c5a1e853857a34112f1 /src/TorrentMan.cc
parent87a30ff857d3269c37a7ebb6c4f530ad62fd9e6c (diff)
parent003a47435758a976a57c483c37859989105e204e (diff)
Tagging 0.5.2 release of aria2release-0.5.2
Diffstat (limited to 'src/TorrentMan.cc')
-rw-r--r--src/TorrentMan.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/TorrentMan.cc b/src/TorrentMan.cc
index 1e607dc1..ebdd9f80 100644
--- a/src/TorrentMan.cc
+++ b/src/TorrentMan.cc
@@ -651,7 +651,7 @@ void TorrentMan::onDownloadComplete() {
void TorrentMan::advertisePiece(int cuid, int index) {
HaveEntry entry(cuid, index);
- haves.push_back(entry);
+ haves.push_front(entry);
};
PieceIndexes TorrentMan::getAdvertisedPieceIndexes(int myCuid,
@@ -659,9 +659,12 @@ PieceIndexes TorrentMan::getAdvertisedPieceIndexes(int myCuid,
PieceIndexes indexes;
for(Haves::const_iterator itr = haves.begin(); itr != haves.end(); itr++) {
const Haves::value_type& have = *itr;
- if(have.cuid == myCuid || lastCheckTime.isNewer(have.registeredTime)) {
+ if(have.cuid == myCuid) {
continue;
}
+ if(lastCheckTime.isNewer(have.registeredTime)) {
+ break;
+ }
indexes.push_back(have.index);
}
return indexes;