From c6b7cca5fe2ffa15ccf46feb44ede208a8e135b8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 18 Nov 2018 19:02:13 +0900 Subject: [PATCH] Don't send Accept Metalink header if Metalink is disabled --- src/DownloadContext.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DownloadContext.cc b/src/DownloadContext.cc index 80edf2d9..7f175e26 100644 --- a/src/DownloadContext.cc +++ b/src/DownloadContext.cc @@ -54,7 +54,11 @@ DownloadContext::DownloadContext() pieceLength_(0), checksumVerified_(false), knowsTotalLength_(true), +#ifdef ENABLE_METALINK acceptMetalink_(true) +#else // !ENABLE_METALINK + acceptMetalink_(false) +#endif // !ENABLE_METALINK { } @@ -66,7 +70,11 @@ DownloadContext::DownloadContext(int32_t pieceLength, int64_t totalLength, pieceLength_(pieceLength), checksumVerified_(false), knowsTotalLength_(true), +#ifdef ENABLE_METALINK acceptMetalink_(true) +#else // !ENABLE_METALINK + acceptMetalink_(false) +#endif // !ENABLE_METALINK { fileEntries_.push_back( std::make_shared(std::move(path), totalLength, 0));