/* */ #include "PieceHashCheckIntegrityEntry.h" #include "RequestGroup.h" #include "IteratableChunkChecksumValidator.h" #include "DownloadContext.h" #include "PieceStorage.h" namespace aria2 { PieceHashCheckIntegrityEntry::PieceHashCheckIntegrityEntry (RequestGroup* requestGroup, Command* nextCommand): CheckIntegrityEntry(requestGroup, nextCommand) {} PieceHashCheckIntegrityEntry::~PieceHashCheckIntegrityEntry() {} bool PieceHashCheckIntegrityEntry::isValidationReady() { const SharedHandle& dctx = getRequestGroup()->getDownloadContext(); return dctx->isPieceHashVerificationAvailable(); } void PieceHashCheckIntegrityEntry::initValidator() { #ifdef ENABLE_MESSAGE_DIGEST IteratableChunkChecksumValidatorHandle validator (new IteratableChunkChecksumValidator (getRequestGroup()->getDownloadContext(), getRequestGroup()->getPieceStorage())); validator->init(); setValidator(validator); #endif // ENABLE_MESSAGE_DIGEST } } // namespace aria2