Merge pull request #1300 from aria2/accept-metalink

Don't send Accept Metalink header if Metalink is disabled
pull/1306/head
Tatsuhiro Tsujikawa 2018-11-18 21:38:06 +09:00 committed by GitHub
commit 6c30b13a91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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<FileEntry>(std::move(path), totalLength, 0));