diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-11-12 11:28:16 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-11-12 11:28:16 +0000 |
| commit | 7c41d11be325a2f85108a28a2111353ad0e208b4 (patch) | |
| tree | 9b5909898bc7ecdaaf7cd2b0ff170334d05442c9 /src/CheckIntegrityEntry.cc | |
| parent | 4f59dc84bfa4be6e5fcea98b5f8775ddf7764dfa (diff) | |
2007-11-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented checksum validation feature(1 checksum for each
file)
The validation takes place after the download.
* src/PieceHashCheckIntegrityEntry.{h, cc}: New class.
* src/IteratableChecksumValidator.{h, cc}: Rewritten.
* src/CheckIntegrityCommand.cc: Changed log message.
* src/Metalink2RequestGroup.cc: Set checksum to
SingleFileDownloadContext.
* src/StreamCheckIntegrityEntry.{h, cc}: Now derived from
PieceHashCheckIntegrity class.
* src/BtCheckIntegrityEntry.{h, cc}: Now derived from
PieceHashCheckIntegrity class.
* src/ChecksumCheckIntegrityEntry.{h, cc}: New class.
* src/IteratableValidator.h: New class.
* src/message.h
* src/CheckIntegrityEntry.{h, cc}
* src/IteratableChunkChecksumValidator.{h, cc}
* src/SingleFileDownloadContext.h
* src/DownloadCommand.cc
--allow-overwrite=true is no longer needed to check file
integrity
before download in BitTorrent download.
* src/RequestGroup.cc (getInitialCommand)
Removed RequestGroup from queue when
RequestGroup::getInitialCommand()
throws exception.
* src/RequestGroupMan.cc (getInitialCommands)
Diffstat (limited to 'src/CheckIntegrityEntry.cc')
| -rw-r--r-- | src/CheckIntegrityEntry.cc | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/CheckIntegrityEntry.cc b/src/CheckIntegrityEntry.cc index 0377b907..43f5a6a1 100644 --- a/src/CheckIntegrityEntry.cc +++ b/src/CheckIntegrityEntry.cc @@ -33,12 +33,9 @@ */ /* copyright --> */ #include "CheckIntegrityEntry.h" -#include "DlAbortEx.h" #include "Command.h" #include "RequestGroup.h" -#include "IteratableChunkChecksumValidator.h" -#include "DownloadContext.h" -#include "DownloadEngine.h" +#include "IteratableValidator.h" CheckIntegrityEntry::CheckIntegrityEntry(RequestGroup* requestGroup, Command* nextCommand): @@ -75,23 +72,3 @@ bool CheckIntegrityEntry::finished() { return _validator->finished(); } - -bool CheckIntegrityEntry::isValidationReady() -{ - DownloadContextHandle dctx = _requestGroup->getDownloadContext(); - return dctx->getPieceHashes().size() > 0 && - dctx->getPieceHashes().size() == (uint32_t)dctx->getNumPieces(); -} - -void CheckIntegrityEntry::initValidator() -{ - IteratableChunkChecksumValidatorHandle validator = - new IteratableChunkChecksumValidator(_requestGroup->getDownloadContext(), - _requestGroup->getPieceStorage()); - _validator = validator; -} - -void CheckIntegrityEntry::updatePieceStorage() -{ - _validator->updatePieceStorage(); -} |
