diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-03-26 17:12:52 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-03-26 17:20:27 +0900 |
| commit | d64089632e82a2548752c7a6baaa68365a795a74 (patch) | |
| tree | 57fc7b85a8c1290975d58fa4761b04a7695bf7e3 /src/CheckIntegrityEntry.cc | |
| parent | c81b1321122e8509b55c94c0cbca0d8d6d319f0c (diff) | |
| parent | a7cd943a06b1a5ff4515b57060b84037f8d01f9f (diff) | |
Merge branch 'master' into random-webseeding
Diffstat (limited to 'src/CheckIntegrityEntry.cc')
| -rw-r--r-- | src/CheckIntegrityEntry.cc | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/CheckIntegrityEntry.cc b/src/CheckIntegrityEntry.cc index 3f23a7fa..9a634050 100644 --- a/src/CheckIntegrityEntry.cc +++ b/src/CheckIntegrityEntry.cc @@ -46,58 +46,55 @@ namespace aria2 { CheckIntegrityEntry::CheckIntegrityEntry(RequestGroup* requestGroup, std::unique_ptr<Command> nextCommand) - : RequestGroupEntry{requestGroup, std::move(nextCommand)} -{} + : RequestGroupEntry{requestGroup, std::move(nextCommand)} +{ +} CheckIntegrityEntry::~CheckIntegrityEntry() {} -void CheckIntegrityEntry::validateChunk() -{ - validator_->validateChunk(); -} +void CheckIntegrityEntry::validateChunk() { validator_->validateChunk(); } int64_t CheckIntegrityEntry::getTotalLength() { - if(!validator_) { + if (!validator_) { return 0; - } else { + } + else { return validator_->getTotalLength(); } } int64_t CheckIntegrityEntry::getCurrentLength() { - if(!validator_) { + if (!validator_) { return 0; - } else { + } + else { return validator_->getCurrentOffset(); } } -bool CheckIntegrityEntry::finished() -{ - return validator_->finished(); -} +bool CheckIntegrityEntry::finished() { return validator_->finished(); } void CheckIntegrityEntry::cutTrailingGarbage() { getRequestGroup()->getPieceStorage()->getDiskAdaptor()->cutTrailingGarbage(); } -void CheckIntegrityEntry::proceedFileAllocation -(std::vector<std::unique_ptr<Command>>& commands, - std::unique_ptr<FileAllocationEntry> entry, - DownloadEngine* e) +void CheckIntegrityEntry::proceedFileAllocation( + std::vector<std::unique_ptr<Command>>& commands, + std::unique_ptr<FileAllocationEntry> entry, DownloadEngine* e) { - if(getRequestGroup()->needsFileAllocation()) { + if (getRequestGroup()->needsFileAllocation()) { e->getFileAllocationMan()->pushEntry(std::move(entry)); - } else { + } + else { entry->prepareForNextAction(commands, e); } } -void CheckIntegrityEntry::setValidator -(std::unique_ptr<IteratableValidator> validator) +void CheckIntegrityEntry::setValidator( + std::unique_ptr<IteratableValidator> validator) { validator_ = std::move(validator); } |
