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

Fixed: numCommand is less than the value specified in -C option.
	* src/RequestGroup.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-08-13 16:15:31 +00:00
parent 326d11bc46
commit 2283c5ee14
2 changed files with 9 additions and 3 deletions

View File

@ -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.

View File

@ -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);