summaryrefslogtreecommitdiff
path: root/src/PieceHashCheckIntegrityEntry.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/PieceHashCheckIntegrityEntry.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/PieceHashCheckIntegrityEntry.cc')
-rw-r--r--src/PieceHashCheckIntegrityEntry.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/PieceHashCheckIntegrityEntry.cc b/src/PieceHashCheckIntegrityEntry.cc
index aea5d80c..40665b76 100644
--- a/src/PieceHashCheckIntegrityEntry.cc
+++ b/src/PieceHashCheckIntegrityEntry.cc
@@ -51,9 +51,7 @@ bool PieceHashCheckIntegrityEntry::isValidationReady()
{
const SharedHandle<DownloadContext>& dctx =
getRequestGroup()->getDownloadContext();
- return !dctx->getPieceHashAlgo().empty() &&
- dctx->getPieceHashes().size() > 0 &&
- dctx->getPieceHashes().size() == dctx->getNumPieces();
+ return dctx->isPieceHashVerificationAvailable();
}
void PieceHashCheckIntegrityEntry::initValidator()