summaryrefslogtreecommitdiff
path: root/src/CheckIntegrityCommand.cc
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/CheckIntegrityCommand.cc
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/CheckIntegrityCommand.cc')
-rw-r--r--src/CheckIntegrityCommand.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/CheckIntegrityCommand.cc b/src/CheckIntegrityCommand.cc
index 3b652898..d5db23c5 100644
--- a/src/CheckIntegrityCommand.cc
+++ b/src/CheckIntegrityCommand.cc
@@ -62,12 +62,13 @@ bool CheckIntegrityCommand::executeInternal()
}
_entry->validateChunk();
if(_entry->finished()) {
- _entry->updatePieceStorage();
if(_requestGroup->downloadFinished()) {
- logger->notice(MSG_DOWNLOAD_ALREADY_COMPLETED, _requestGroup->getGID(),
+ logger->notice(MSG_VERIFICATION_SUCCESSFUL,
_requestGroup->getFilePath().c_str());
_e->addCommand(_entry->onDownloadFinished(_e));
} else {
+ logger->error(MSG_VERIFICATION_FAILED,
+ _requestGroup->getFilePath().c_str());
_e->addCommand(_entry->onDownloadIncomplete(_e));
}
return true;