summaryrefslogtreecommitdiff
path: root/src/RequestGroup.cc
diff options
context:
space:
mode:
authorNils Maier <maierman@web.de>2014-04-17 01:36:19 +0200
committerNils Maier <maierman@web.de>2014-04-17 18:02:42 +0200
commit010131161ebdea22e5b6eb4fd0740e8e6da3df67 (patch)
tree3a768bbd2796056c65de9630a6ab6946d4eda43f /src/RequestGroup.cc
parentbefd799d177c2860ea4e9c6cf8c744342c394427 (diff)
Remove ENABLE_MESSAGE_DIGEST, since we got the internal md, always
Diffstat (limited to 'src/RequestGroup.cc')
-rw-r--r--src/RequestGroup.cc18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc
index 2b3e1410..d0035212 100644
--- a/src/RequestGroup.cc
+++ b/src/RequestGroup.cc
@@ -79,10 +79,8 @@
#include "Segment.h"
#include "SocketRecvBuffer.h"
#include "RequestGroupCriteria.h"
-#ifdef ENABLE_MESSAGE_DIGEST
-# include "CheckIntegrityCommand.h"
-# include "ChecksumCheckIntegrityEntry.h"
-#endif // ENABLE_MESSAGE_DIGEST
+#include "CheckIntegrityCommand.h"
+#include "ChecksumCheckIntegrityEntry.h"
#ifdef ENABLE_BITTORRENT
# include "bittorrent_helper.h"
# include "BtRegistry.h"
@@ -240,14 +238,12 @@ std::unique_ptr<CheckIntegrityEntry> RequestGroup::createCheckIntegrityEntry()
// issue checksum verification and download fails without it.
loadAndOpenFile(infoFile);
if(downloadFinished()) {
-#ifdef ENABLE_MESSAGE_DIGEST
if(downloadContext_->isChecksumVerificationNeeded()) {
A2_LOG_INFO(MSG_HASH_CHECK_NOT_DONE);
auto tempEntry = make_unique<ChecksumCheckIntegrityEntry>(this);
tempEntry->setRedownload(true);
return std::move(tempEntry);
}
-#endif // ENABLE_MESSAGE_DIGEST
downloadContext_->setChecksumVerified(true);
A2_LOG_NOTICE(fmt(MSG_DOWNLOAD_ALREADY_COMPLETED,
gid_->toHex().c_str(),
@@ -257,7 +253,6 @@ std::unique_ptr<CheckIntegrityEntry> RequestGroup::createCheckIntegrityEntry()
return make_unique<StreamCheckIntegrityEntry>(this);
}
-#ifdef ENABLE_MESSAGE_DIGEST
if (downloadFinishedByFileLength() &&
downloadContext_->isChecksumVerificationAvailable()) {
pieceStorage_->markAllPiecesDone();
@@ -266,7 +261,6 @@ std::unique_ptr<CheckIntegrityEntry> RequestGroup::createCheckIntegrityEntry()
tempEntry->setRedownload(true);
return std::move(tempEntry);
}
-#endif // ENABLE_MESSAGE_DIGEST
loadAndOpenFile(infoFile);
return make_unique<StreamCheckIntegrityEntry>(this);
@@ -520,7 +514,6 @@ void RequestGroup::processCheckIntegrityEntry(
if(actualFileSize > downloadContext_->getTotalLength()) {
entry->cutTrailingGarbage();
}
-#ifdef ENABLE_MESSAGE_DIGEST
if((option_->getAsBool(PREF_CHECK_INTEGRITY) ||
downloadContext_->isChecksumVerificationNeeded()) &&
entry->isValidationReady()) {
@@ -535,7 +528,6 @@ void RequestGroup::processCheckIntegrityEntry(
e->getCheckIntegrityMan()->pushEntry(std::move(entry));
return;
}
-#endif // ENABLE_MESSAGE_DIGEST
entry->onDownloadIncomplete(commands, e);
}
@@ -664,16 +656,12 @@ void RequestGroup::adjustFilename(
outfile.size() <= downloadContext_->getTotalLength()) {
// File exists but user decided to resume it.
}
-#ifdef ENABLE_MESSAGE_DIGEST
else if(outfile.exists() && isCheckIntegrityReady()) {
// check-integrity existing file
}
-#endif // ENABLE_MESSAGE_DIGEST
else {
shouldCancelDownloadForSafety();
-#ifdef ENABLE_MESSAGE_DIGEST
}
-#endif // ENABLE_MESSAGE_DIGEST
}
void RequestGroup::removeDefunctControlFile(
@@ -709,11 +697,9 @@ void RequestGroup::loadAndOpenFile(
pieceStorage_->getDiskAdaptor()->openExistingFile();
pieceStorage_->markPiecesDone(outfile.size());
}
-#ifdef ENABLE_MESSAGE_DIGEST
else if (outfile.exists() && isCheckIntegrityReady()) {
pieceStorage_->getDiskAdaptor()->openExistingFile();
}
-#endif // ENABLE_MESSAGE_DIGEST
else {
pieceStorage_->getDiskAdaptor()->initAndOpenFile();
}