From 2283c5ee14287ecb087bb5b21868baca111f9327 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 Aug 2008 16:15:31 +0000 Subject: [PATCH] 2008-08-14 Tatsuhiro Tsujikawa Fixed: numCommand is less than the value specified in -C option. * src/RequestGroup.cc --- ChangeLog | 5 +++++ src/RequestGroup.cc | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4999e639..f572a424 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-14 Tatsuhiro Tsujikawa + + Fixed: numCommand is less than the value specified in -C option. + * src/RequestGroup.cc + 2008-08-14 Tatsuhiro Tsujikawa Fixed occasional assertion failure in PieceSegment. diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index f4e7b078..ddde492d 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -486,12 +486,13 @@ void RequestGroup::createNextCommandWithAdj(std::deque& 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(_downloadContext->getNumPieces()), + numCommand); } if(numCommand > 0) { createNextCommand(commands, e, numCommand);