summaryrefslogtreecommitdiff
path: root/src/AdaptiveFileAllocationIterator.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-07-09 13:45:43 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-07-09 13:45:43 +0000
commit53c4de7ffdbf1631674ad2a7644b7062081444e2 (patch)
treea9c07442f2df55c1d71d9be7186ab6c47e0dde77 /src/AdaptiveFileAllocationIterator.cc
parentf285f66ac8a95f175aaedf16783bb62f9821a8fc (diff)
2010-07-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that AdaptiveFileAllocationIterator::finished() returns false even if offset_ >= totalLength_. This causes ftruncate error for seeding torrents. * src/AdaptiveFileAllocationIterator.cc
Diffstat (limited to 'src/AdaptiveFileAllocationIterator.cc')
-rw-r--r--src/AdaptiveFileAllocationIterator.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/AdaptiveFileAllocationIterator.cc b/src/AdaptiveFileAllocationIterator.cc
index 3ec80fb6..d8586384 100644
--- a/src/AdaptiveFileAllocationIterator.cc
+++ b/src/AdaptiveFileAllocationIterator.cc
@@ -93,7 +93,7 @@ void AdaptiveFileAllocationIterator::allocateChunk()
bool AdaptiveFileAllocationIterator::finished()
{
if(allocator_.isNull()) {
- return false;
+ return (uint64_t)offset_ >= totalLength_;
} else {
return allocator_->finished();
}