瀏覽代碼

2008-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Fixed: numCommand is less than the value specified in -C option.
	* src/RequestGroup.cc
Tatsuhiro Tsujikawa 17 年之前
父節點
當前提交
2283c5ee14
共有 2 個文件被更改,包括 9 次插入3 次删除
  1. 5 0
      ChangeLog
  2. 4 3
      src/RequestGroup.cc

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-08-14  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	Fixed: numCommand is less than the value specified in -C option.
+	* src/RequestGroup.cc
+
 2008-08-14  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 	Fixed occasional assertion failure in PieceSegment.

+ 4 - 3
src/RequestGroup.cc

@@ -486,12 +486,13 @@ void RequestGroup::createNextCommandWithAdj(std::deque<Command*>& commands,
     numCommand = 1+numAdj;
   } else {
     if(_numConcurrentCommand == 0) {
-      numCommand = std::min(_downloadContext->getNumPieces(), _uris.size());
+      numCommand = _uris.size();
     } else {
-      numCommand = std::min(_downloadContext->getNumPieces(),
-			    _numConcurrentCommand);
+      numCommand = _numConcurrentCommand;
     }
     numCommand += numAdj;
+    numCommand = std::min(static_cast<int>(_downloadContext->getNumPieces()),
+			  numCommand);
   }
   if(numCommand > 0) {
     createNextCommand(commands, e, numCommand);