pull/1/head
Tatsuhiro Tsujikawa 2006-03-21 17:28:57 +00:00
parent 4b6181b6d1
commit 8ad0037ee2
2 changed files with 4 additions and 2 deletions

View File

@ -218,9 +218,11 @@ void TorrentMan::completePiece(const Piece& piece) {
if(Piece::isNull(piece)) { if(Piece::isNull(piece)) {
return; return;
} }
if(!hasPiece(piece.getIndex())) {
addDownloadedSize(piece.getLength());
}
bitfield->setBit(piece.getIndex()); bitfield->setBit(piece.getIndex());
bitfield->unsetUseBit(piece.getIndex()); bitfield->unsetUseBit(piece.getIndex());
addDownloadedSize(piece.getLength());
deleteUsedPiece(piece); deleteUsedPiece(piece);
if(!isEndGame()) { if(!isEndGame()) {
reduceUsedPieces(100); reduceUsedPieces(100);

View File

@ -51,7 +51,7 @@ bool TrackerInitCommand::execute() {
"port="+Util::itos(e->torrentMan->getPort())+"&"+ "port="+Util::itos(e->torrentMan->getPort())+"&"+
"uploaded="+Util::llitos(e->torrentMan->getUploadedSize())+"&"+ "uploaded="+Util::llitos(e->torrentMan->getUploadedSize())+"&"+
"downloaded="+Util::llitos(e->torrentMan->getDownloadedSize())+"&"+ "downloaded="+Util::llitos(e->torrentMan->getDownloadedSize())+"&"+
"left="+Util::llitos(e->torrentMan->totalSize-e->torrentMan->getDownloadedSize())+"&"+ "left="+(e->torrentMan->downloadComplete() ? "0" : Util::llitos(e->torrentMan->totalSize-e->torrentMan->getDownloadedSize()))+"&"+
"compact=1"; "compact=1";
if(!event.empty()) { if(!event.empty()) {
url += string("&")+"event="+event; url += string("&")+"event="+event;