diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-01-24 10:40:42 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-01-24 10:40:42 +0000 |
| commit | adf91f656b3f99ab3a624418b170b9183bfe8d8c (patch) | |
| tree | 40d14bb702aaaf1f8f253b1f2759d9a0c7ed8d89 /src/CheckIntegrityCommand.cc | |
| parent | 5da58fe01d31fe2ab647764308dbdb5d93cd721e (diff) | |
2009-01-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made (piece) hash check sequential for each RequestGroup because
simultaneous hash check is slower than sequential execution.
* src/CheckIntegrityCommand.cc
* src/CheckIntegrityDispatcherCommand.cc
* src/CheckIntegrityDispatcherCommand.h
* src/CheckIntegrityMan.h
* src/ConsoleStatCalc.cc
* src/DownloadCommand.cc
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/DownloadEngineFactory.cc
* src/Makefile.am
* src/Makefile.in
* src/RequestGroup.cc
* src/StatCalc.h
Diffstat (limited to 'src/CheckIntegrityCommand.cc')
| -rw-r--r-- | src/CheckIntegrityCommand.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/CheckIntegrityCommand.cc b/src/CheckIntegrityCommand.cc index d65056d2..4c2858e1 100644 --- a/src/CheckIntegrityCommand.cc +++ b/src/CheckIntegrityCommand.cc @@ -33,7 +33,6 @@ */ /* copyright --> */ #include "CheckIntegrityCommand.h" -#include "CheckIntegrityMan.h" #include "CheckIntegrityEntry.h" #include "DownloadEngine.h" #include "RequestGroup.h" @@ -43,17 +42,14 @@ namespace aria2 { -CheckIntegrityCommand::CheckIntegrityCommand(int32_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const CheckIntegrityEntryHandle& entry): +CheckIntegrityCommand::CheckIntegrityCommand +(int32_t cuid, RequestGroup* requestGroup, DownloadEngine* e, + const CheckIntegrityEntryHandle& entry): RealtimeCommand(cuid, requestGroup, e), _entry(entry) -{ - _e->_checkIntegrityMan->addCheckIntegrityEntry(_entry); -} +{} -CheckIntegrityCommand::~CheckIntegrityCommand() -{ - _e->_checkIntegrityMan->removeCheckIntegrityEntry(_entry); -} +CheckIntegrityCommand::~CheckIntegrityCommand() {} bool CheckIntegrityCommand::executeInternal() { @@ -62,6 +58,8 @@ bool CheckIntegrityCommand::executeInternal() } _entry->validateChunk(); if(_entry->finished()) { + _e->_checkIntegrityMan->dropPickedEntry(); + if(_requestGroup->downloadFinished()) { logger->notice(MSG_VERIFICATION_SUCCESSFUL, _requestGroup->getFilePath().c_str()); @@ -85,8 +83,10 @@ bool CheckIntegrityCommand::executeInternal() bool CheckIntegrityCommand::handleException(Exception& e) { + _e->_checkIntegrityMan->dropPickedEntry(); logger->error(MSG_FILE_VALIDATION_FAILURE, e, cuid); - logger->error(MSG_DOWNLOAD_NOT_COMPLETE, cuid, _requestGroup->getFilePath().c_str()); + logger->error(MSG_DOWNLOAD_NOT_COMPLETE, + cuid, _requestGroup->getFilePath().c_str()); return true; } |
