summaryrefslogtreecommitdiff
path: root/src/ChecksumCheckIntegrityEntry.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-09-15 11:46:25 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-09-15 11:46:25 +0000
commita27968bedadaca57e1792ae410d1a946fd936646 (patch)
treee8ac4ebc9981f2ffdc145bc5d259b850bc479a5d /src/ChecksumCheckIntegrityEntry.cc
parent7f92e32e485cfd99cce33568c04775e2413b5517 (diff)
2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that a file gets overwritten if -V is given and no hash is provided. Fixed the bug that --dry-run leads download error. Added RequestGroup::createCheckIntegrityEntry() which correctly creates CheckIntegrityEntry objects and open files based on -V option and the existence of control file. * src/AbstractCommand.cc * src/AbstractCommand.h * src/ChecksumCheckIntegrityEntry.cc * src/DownloadContext.cc * src/DownloadContext.h * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/PieceHashCheckIntegrityEntry.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupEntry.cc * src/RequestGroupEntry.h
Diffstat (limited to 'src/ChecksumCheckIntegrityEntry.cc')
-rw-r--r--src/ChecksumCheckIntegrityEntry.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ChecksumCheckIntegrityEntry.cc b/src/ChecksumCheckIntegrityEntry.cc
index d21e7916..6b384d58 100644
--- a/src/ChecksumCheckIntegrityEntry.cc
+++ b/src/ChecksumCheckIntegrityEntry.cc
@@ -54,8 +54,9 @@ ChecksumCheckIntegrityEntry::~ChecksumCheckIntegrityEntry() {}
bool ChecksumCheckIntegrityEntry::isValidationReady()
{
- return !getRequestGroup()->getDownloadContext()->getChecksum().empty() &&
- !getRequestGroup()->getDownloadContext()->getChecksumHashAlgo().empty();
+ const SharedHandle<DownloadContext>& dctx =
+ getRequestGroup()->getDownloadContext();
+ return dctx->isChecksumVerificationAvailable();
}
void ChecksumCheckIntegrityEntry::initValidator()