diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-09-15 11:46:25 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-09-15 11:46:25 +0000 |
| commit | a27968bedadaca57e1792ae410d1a946fd936646 (patch) | |
| tree | e8ac4ebc9981f2ffdc145bc5d259b850bc479a5d /src/AbstractCommand.cc | |
| parent | 7f92e32e485cfd99cce33568c04775e2413b5517 (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/AbstractCommand.cc')
| -rw-r--r-- | src/AbstractCommand.cc | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc index ae8b0936..616e4612 100644 --- a/src/AbstractCommand.cc +++ b/src/AbstractCommand.cc @@ -777,28 +777,9 @@ std::string AbstractCommand::resolveHostname return ipaddr; } -// nextCommand is going to be managed by CheckIntegrityEntry which is -// created in side this function. Don't release nextCommand after this -// function call. -void AbstractCommand::prepareForNextAction(Command* nextCommand) +void AbstractCommand::prepareForNextAction +(const SharedHandle<CheckIntegrityEntry>& checkEntry) { - SharedHandle<CheckIntegrityEntry> checkEntry; -#ifdef ENABLE_MESSAGE_DIGEST - if(requestGroup_->downloadFinished() && - getDownloadContext()->isChecksumVerificationNeeded()) { - if(getLogger()->info()) { - getLogger()->info(MSG_HASH_CHECK_NOT_DONE); - } - SharedHandle<ChecksumCheckIntegrityEntry> entry - (new ChecksumCheckIntegrityEntry(requestGroup_, nextCommand)); - entry->setRedownload(true); - checkEntry = entry; - } else -#endif // ENABLE_MESSAGE_DIGEST - { - checkEntry.reset - (new StreamCheckIntegrityEntry(requestGroup_, nextCommand)); - } std::vector<Command*>* commands = new std::vector<Command*>(); auto_delete_container<std::vector<Command*> > commandsDel(commands); requestGroup_->processCheckIntegrityEntry(*commands, checkEntry, e_); |
