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
pull/1/head
Tatsuhiro Tsujikawa 2010-03-07 03:10:19 +00:00
parent 7923125382
commit f3973e5a12
4 changed files with 38 additions and 0 deletions

View File

@ -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>
Added 'status' key to the response of getUri XML-RPC method.

View File

@ -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,
DownloadEngine* e,
unsigned int numCommand)

View File

@ -208,6 +208,8 @@ public:
void createNextCommand(std::vector<Command*>& commands,
DownloadEngine* e, unsigned int numCommand);
void createNextCommand(std::vector<Command*>& commands, DownloadEngine* e);
bool downloadFinished() const;
bool allDownloadFinished() const;

View File

@ -917,6 +917,11 @@ BDE ChangeUriXmlRpcMethod::process
}
}
}
if(addcount) {
std::vector<Command*> commands;
group->createNextCommand(commands, e);
e->addCommand(commands);
}
BDE res = BDE::list();
res << delcount;
res << addcount;