Skip to content

Commit

Permalink
Merge pull request aria2#1065 from kwkam/unknown-stat
Browse files Browse the repository at this point in the history
UnknownLengthPieceStorage: Completed Length
  • Loading branch information
tatsuhiro-t authored Nov 8, 2017
2 parents 45756dd + eef212d commit 5e7976a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/UnknownLengthPieceStorage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ bool UnknownLengthPieceStorage::isPieceUsed(size_t index)
}
}

int64_t UnknownLengthPieceStorage::getCompletedLength()
{
// TODO we have to return actual completed length here?
if (piece_) {
return piece_->getLength();
}
return totalLength_;
}

std::shared_ptr<DiskAdaptor> UnknownLengthPieceStorage::getDiskAdaptor()
{
return diskAdaptor_;
Expand Down
6 changes: 1 addition & 5 deletions src/UnknownLengthPieceStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,7 @@ class UnknownLengthPieceStorage : public PieceStorage {
return totalLength_;
}

virtual int64_t getCompletedLength() CXX11_OVERRIDE
{
// TODO we have to return actual completed length here?
return totalLength_;
}
virtual int64_t getCompletedLength() CXX11_OVERRIDE;

virtual int64_t getFilteredCompletedLength() CXX11_OVERRIDE
{
Expand Down

0 comments on commit 5e7976a

Please sign in to comment.