diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-03-24 14:32:49 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-03-24 14:32:49 +0000 |
| commit | a37aaa9c0c43c1013b323f28545eb9330d56dee3 (patch) | |
| tree | 0aef46aad2dee8da1dd5f95d9a9d90100caa90b7 /src/AbstractDiskWriter.h | |
| parent | 5649cf6cda777cff7749b12f5286272959520a4f (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/AbstractDiskWriter.h')
| -rw-r--r-- | src/AbstractDiskWriter.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/AbstractDiskWriter.h b/src/AbstractDiskWriter.h index b6807e46..2ba973df 100644 --- a/src/AbstractDiskWriter.h +++ b/src/AbstractDiskWriter.h @@ -44,6 +44,7 @@ protected: string filename; int32_t fd; FileAllocatorHandle fileAllocator; + FileAllocatorHandle glowFileAllocator; const Logger* logger; void createFile(const string& filename, int32_t addFlags = 0); @@ -62,7 +63,7 @@ public: virtual void closeFile(); - virtual void openExistingFile(const string& filename); + virtual void openExistingFile(const string& filename, int64_t totalLength = 0); #ifdef ENABLE_MESSAGE_DIGEST virtual string messageDigest(int64_t offset, int64_t length, @@ -73,9 +74,15 @@ public: virtual int32_t readData(char* data, int32_t len, int64_t offset); - void setFileAllocator(const FileAllocatorHandle& fileAllocator) { + void setFileAllocator(const FileAllocatorHandle& fileAllocator) + { this->fileAllocator = fileAllocator; } + + void setGlowFileAllocator(const FileAllocatorHandle& fileAllocator) + { + this->glowFileAllocator = fileAllocator; + } }; #endif // _D_ABSTRACT_DISK_WRITER_H_ |
