summaryrefslogtreecommitdiff
path: root/src/CheckIntegrityEntry.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-12 11:28:16 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-12 11:28:16 +0000
commit7c41d11be325a2f85108a28a2111353ad0e208b4 (patch)
tree9b5909898bc7ecdaaf7cd2b0ff170334d05442c9 /src/CheckIntegrityEntry.h
parent4f59dc84bfa4be6e5fcea98b5f8775ddf7764dfa (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.h')
-rw-r--r--src/CheckIntegrityEntry.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/CheckIntegrityEntry.h b/src/CheckIntegrityEntry.h
index a6d0bf1c..df22a79e 100644
--- a/src/CheckIntegrityEntry.h
+++ b/src/CheckIntegrityEntry.h
@@ -37,16 +37,16 @@
#include "RequestGroupEntry.h"
-class IteratableChunkChecksumValidator;
-extern typedef SharedHandle<IteratableChunkChecksumValidator> IteratableChunkChecksumValidatorHandle;
+class IteratableValidator;
+extern typedef SharedHandle<IteratableValidator> IteratableValidatorHandle;
class Command;
extern typedef deque<Command*> Commands;
class DownloadEngine;
class CheckIntegrityEntry : public RequestGroupEntry,
public ProgressAwareEntry {
-private:
- IteratableChunkChecksumValidatorHandle _validator;
+protected:
+ IteratableValidatorHandle _validator;
public:
CheckIntegrityEntry(RequestGroup* requestGroup, Command* nextCommand = 0);
@@ -56,15 +56,13 @@ public:
virtual int64_t getCurrentLength();
- virtual bool finished();
-
- bool isValidationReady();
+ virtual void validateChunk();
- void initValidator();
+ virtual bool finished();
- void validateChunk();
+ virtual bool isValidationReady() = 0;
- void updatePieceStorage();
+ virtual void initValidator() = 0;
virtual Commands onDownloadFinished(DownloadEngine* e) = 0;