mirror of https://github.com/aria2/aria2
2008-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Limited numCommand less than or equal to the number of piece. * src/RequestGroup.ccpull/1/head
parent
4baee78941
commit
a699a46858
|
@ -1,3 +1,8 @@
|
||||||
|
2008-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Limited numCommand less than or equal to the number of piece.
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
|
||||||
2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Eliminated randomness from the test case. Removed #ifdef __MINGW32
|
Eliminated randomness from the test case. Removed #ifdef __MINGW32
|
||||||
|
|
|
@ -481,18 +481,21 @@ bool RequestGroup::tryAutoFileRenaming()
|
||||||
void RequestGroup::createNextCommandWithAdj(std::deque<Command*>& commands,
|
void RequestGroup::createNextCommandWithAdj(std::deque<Command*>& commands,
|
||||||
DownloadEngine* e, int numAdj)
|
DownloadEngine* e, int numAdj)
|
||||||
{
|
{
|
||||||
unsigned int numCommand;
|
int numCommand;
|
||||||
|
if(getTotalLength() == 0) {
|
||||||
|
numCommand = 1+numAdj;
|
||||||
|
} else {
|
||||||
if(_numConcurrentCommand == 0) {
|
if(_numConcurrentCommand == 0) {
|
||||||
numCommand = _uris.size();
|
numCommand = std::min(_downloadContext->getNumPieces(), _uris.size());
|
||||||
} else {
|
} else {
|
||||||
int n = _numConcurrentCommand+numAdj;
|
numCommand = std::min(_downloadContext->getNumPieces(),
|
||||||
if(n > 0) {
|
_numConcurrentCommand);
|
||||||
numCommand = n;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
numCommand += numAdj;
|
||||||
|
}
|
||||||
|
if(numCommand > 0) {
|
||||||
|
createNextCommand(commands, e, numCommand);
|
||||||
}
|
}
|
||||||
createNextCommand(commands, e, numCommand, Request::METHOD_GET);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RequestGroup::createNextCommand(std::deque<Command*>& commands,
|
void RequestGroup::createNextCommand(std::deque<Command*>& commands,
|
||||||
|
|
Loading…
Reference in New Issue