summaryrefslogtreecommitdiff
path: root/src/Metalink2RequestGroup.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-09-27 21:48:41 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-09-27 21:48:41 +0900
commit7e7aeac3ff12ecac15995c83cf51e66338d64447 (patch)
tree4ac0eefe41e1c3712322f3997f4b21c79fecae8b /src/Metalink2RequestGroup.cc
parent05104ba177d792b74c6455516e063c4d9a5a8ebd (diff)
Added --piece-length option.
This option sets a piece length for HTTP/FTP downloads. This is the boundary when aria2 splits a file. All splits occur at multiple of this length. This option will be ignored in BitTorrent downloads. It will be also ignored if Metalink file contains piece hashes.
Diffstat (limited to 'src/Metalink2RequestGroup.cc')
-rw-r--r--src/Metalink2RequestGroup.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Metalink2RequestGroup.cc b/src/Metalink2RequestGroup.cc
index 07291dda..21f1f289 100644
--- a/src/Metalink2RequestGroup.cc
+++ b/src/Metalink2RequestGroup.cc
@@ -243,12 +243,12 @@ Metalink2RequestGroup::createRequestGroup
size_t pieceLength;
#ifdef ENABLE_MESSAGE_DIGEST
if(!entry->chunkChecksum) {
- pieceLength = option->getAsInt(PREF_SEGMENT_SIZE);
+ pieceLength = option->getAsInt(PREF_PIECE_LENGTH);
} else {
pieceLength = entry->chunkChecksum->getPieceLength();
}
#else
- pieceLength = option->getAsInt(PREF_SEGMENT_SIZE);
+ pieceLength = option->getAsInt(PREF_PIECE_LENGTH);
#endif // ENABLE_MESSAGE_DIGEST
dctx.reset(new DownloadContext
(pieceLength,
@@ -281,7 +281,7 @@ Metalink2RequestGroup::createRequestGroup
} else {
dctx.reset(new DownloadContext());
// piece length is overridden by the one in torrent file.
- dctx->setPieceLength(option->getAsInt(PREF_SEGMENT_SIZE));
+ dctx->setPieceLength(option->getAsInt(PREF_PIECE_LENGTH));
std::vector<SharedHandle<FileEntry> > fileEntries;
off_t offset = 0;
for(std::vector<SharedHandle<MetalinkEntry> >::const_iterator i =