Browse Source

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
Tatsuhiro Tsujikawa 15 years ago
parent
commit
53c4de7ffd
2 changed files with 8 additions and 1 deletions
  1. 7 0
      ChangeLog
  2. 1 1
      src/AdaptiveFileAllocationIterator.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+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
+
 2010-07-09  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Send each CWD component of FTP URI in separate CWD command as

+ 1 - 1
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();
   }