Merge pull request #1065 from kwkam/unknown-stat

UnknownLengthPieceStorage: Completed Length
pull/1167/head
Tatsuhiro Tsujikawa 2017-11-08 23:01:20 +09:00 committed by GitHub
commit 5e7976af89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -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_;

View File

@ -162,11 +162,7 @@ public:
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
{