diff options
Diffstat (limited to 'src/AdaptiveFileAllocationIterator.cc')
| -rw-r--r-- | src/AdaptiveFileAllocationIterator.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/AdaptiveFileAllocationIterator.cc b/src/AdaptiveFileAllocationIterator.cc index cd1fe1e5..347ae0df 100644 --- a/src/AdaptiveFileAllocationIterator.cc +++ b/src/AdaptiveFileAllocationIterator.cc @@ -34,13 +34,13 @@ /* copyright --> */ #include "AdaptiveFileAllocationIterator.h" #include "BinaryStream.h" -#ifdef HAVE_FALLOCATE -# include "FallocFileAllocationIterator.h" -#endif // HAVE_FALLOCATE #include "SingleFileAllocationIterator.h" #include "RecoverableException.h" #include "LogFactory.h" #include "Logger.h" +#ifdef HAVE_FALLOCATE +# include "FallocFileAllocationIterator.h" +#endif // HAVE_FALLOCATE namespace aria2 { @@ -99,4 +99,18 @@ bool AdaptiveFileAllocationIterator::finished() } } +off_t AdaptiveFileAllocationIterator::getCurrentLength() +{ + if(!allocator_) { + return offset_; + } else { + return allocator_->getCurrentLength(); + } +} + +uint64_t AdaptiveFileAllocationIterator::getTotalLength() +{ + return totalLength_; +} + } // namespace aria2 |
