mirror of https://github.com/aria2/aria2
2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Create CreateRequestCommand to the number of -s/-C when URIs are added by XML-RPC. * src/RequestGroup.cc * src/RequestGroup.h * src/XmlRpcMethodImpl.ccpull/1/head
parent
7923125382
commit
f3973e5a12
|
@ -1,3 +1,11 @@
|
||||||
|
2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Create CreateRequestCommand to the number of -s/-C when URIs are
|
||||||
|
added by XML-RPC.
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
* src/RequestGroup.h
|
||||||
|
* src/XmlRpcMethodImpl.cc
|
||||||
|
|
||||||
2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Added 'status' key to the response of getUri XML-RPC method.
|
Added 'status' key to the response of getUri XML-RPC method.
|
||||||
|
|
|
@ -684,6 +684,29 @@ void RequestGroup::createNextCommandWithAdj(std::vector<Command*>& commands,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RequestGroup::createNextCommand(std::vector<Command*>& commands,
|
||||||
|
DownloadEngine* e)
|
||||||
|
{
|
||||||
|
int numCommand;
|
||||||
|
if(getTotalLength() == 0) {
|
||||||
|
if(_numStreamConnection > 0) {
|
||||||
|
numCommand = 0;
|
||||||
|
} else {
|
||||||
|
numCommand = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(_numStreamConnection >= _numConcurrentCommand) {
|
||||||
|
numCommand = 0;
|
||||||
|
} else {
|
||||||
|
numCommand = std::min(_downloadContext->getNumPieces(),
|
||||||
|
_numConcurrentCommand-_numStreamConnection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(numCommand > 0) {
|
||||||
|
createNextCommand(commands, e, numCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RequestGroup::createNextCommand(std::vector<Command*>& commands,
|
void RequestGroup::createNextCommand(std::vector<Command*>& commands,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
unsigned int numCommand)
|
unsigned int numCommand)
|
||||||
|
|
|
@ -208,6 +208,8 @@ public:
|
||||||
void createNextCommand(std::vector<Command*>& commands,
|
void createNextCommand(std::vector<Command*>& commands,
|
||||||
DownloadEngine* e, unsigned int numCommand);
|
DownloadEngine* e, unsigned int numCommand);
|
||||||
|
|
||||||
|
void createNextCommand(std::vector<Command*>& commands, DownloadEngine* e);
|
||||||
|
|
||||||
bool downloadFinished() const;
|
bool downloadFinished() const;
|
||||||
|
|
||||||
bool allDownloadFinished() const;
|
bool allDownloadFinished() const;
|
||||||
|
|
|
@ -917,6 +917,11 @@ BDE ChangeUriXmlRpcMethod::process
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(addcount) {
|
||||||
|
std::vector<Command*> commands;
|
||||||
|
group->createNextCommand(commands, e);
|
||||||
|
e->addCommand(commands);
|
||||||
|
}
|
||||||
BDE res = BDE::list();
|
BDE res = BDE::list();
|
||||||
res << delcount;
|
res << delcount;
|
||||||
res << addcount;
|
res << addcount;
|
||||||
|
|
Loading…
Reference in New Issue