diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-22 23:24:39 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-22 23:34:17 +0900 |
| commit | 6c5c79664658e09f2ff8d890bba8106e4e9916c9 (patch) | |
| tree | d8a578a9fbc0f95fc78bef2e7ddc459dcebc1aab /src/BtCheckIntegrityEntry.cc | |
| parent | 0d36c466d9c81030d1622294f2b0ade4fd0b5927 (diff) | |
Added --hash-check-only opiton.
Added --hash-check-only opiton. If true is given, after hash check
using --check-integrity option, abort download whether or not download
is complete. The default value is false.
Diffstat (limited to 'src/BtCheckIntegrityEntry.cc')
| -rw-r--r-- | src/BtCheckIntegrityEntry.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/BtCheckIntegrityEntry.cc b/src/BtCheckIntegrityEntry.cc index 050b4ce5..a51f17ca 100644 --- a/src/BtCheckIntegrityEntry.cc +++ b/src/BtCheckIntegrityEntry.cc @@ -51,6 +51,9 @@ BtCheckIntegrityEntry::~BtCheckIntegrityEntry() {} void BtCheckIntegrityEntry::onDownloadIncomplete (std::vector<Command*>& commands, DownloadEngine* e) { + if(getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY)) { + return; + } const SharedHandle<DiskAdaptor>& diskAdaptor = getRequestGroup()->getPieceStorage()->getDiskAdaptor(); if(diskAdaptor->isReadOnlyEnabled()) { @@ -71,7 +74,8 @@ void BtCheckIntegrityEntry::onDownloadFinished // are valid, then aira2 goes to seeding mode. Sometimes it is better // to exit rather than doing seeding. So, it would be good to toggle this // behavior. - if(getRequestGroup()->getOption()->getAsBool(PREF_BT_HASH_CHECK_SEED)) { + if(!getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY) && + getRequestGroup()->getOption()->getAsBool(PREF_BT_HASH_CHECK_SEED)) { SharedHandle<BtFileAllocationEntry> entry (new BtFileAllocationEntry(getRequestGroup())); proceedFileAllocation(commands, entry, e); |
