summaryrefslogtreecommitdiff
path: root/src/ByteArrayDiskWriter.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-03-24 14:32:49 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-03-24 14:32:49 +0000
commita37aaa9c0c43c1013b323f28545eb9330d56dee3 (patch)
tree0aef46aad2dee8da1dd5f95d9a9d90100caa90b7 /src/ByteArrayDiskWriter.cc
parent5649cf6cda777cff7749b12f5286272959520a4f (diff)
2007-03-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add the ability to resume downloading a partially downloaded file which is downloaded from the beginning: * src/FileAllocator.h: Made abstract class. New DefaultFileAllocator takes this role. * src/main.cc: Added -c option. * src/BitfieldMan.h, src/BitfieldMan.cc (setBitRange): New function. * src/DiskWriter.h (openExistingFile): Added totalLength argument. * src/prefs.h (PREF_CONTINUE): New definition. * src/SegmentMan.h, src/SegmentMan.cc (markPieceDone): New function. * src/DefaultDiskWriter.cc (createNewDiskWriter): Add GlowFileAllocator to the new object. * src/AbstractDiskWriter.h (glowFileAllocator): New variable. * src/AbstractDiskWriter.cc (openExistingFile): Now preallocate file space from the end of the existing file if totalLength argument is specified and grater than 0. * src/UrlRequestInfo.cc: If -c option is specified and the file to download exists in local, continue the download of the file. --allow-overwrite=true is assumed in this context. * src/DefaultFileAllocator.h, src/DefaultFileAllocator.cc: New class. * src/GlowFileAllocator.h, src/GlowFileAllocator.cc: New class. Throw exception if --check-integrity=true is specified but chunk checksums are not provided: * src/UrlRequestInfo.cc
Diffstat (limited to 'src/ByteArrayDiskWriter.cc')
-rw-r--r--src/ByteArrayDiskWriter.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ByteArrayDiskWriter.cc b/src/ByteArrayDiskWriter.cc
index ca9564f7..089a6c21 100644
--- a/src/ByteArrayDiskWriter.cc
+++ b/src/ByteArrayDiskWriter.cc
@@ -68,7 +68,8 @@ void ByteArrayDiskWriter::closeFile() {
clear();
}
-void ByteArrayDiskWriter::openExistingFile(const string& filename) {
+void ByteArrayDiskWriter::openExistingFile(const string& filename,
+ int64_t totalLength) {
openFile(filename);
}