Made --max-download-result option available in aria2.changeGlobalOption.

pull/2/head
Tatsuhiro Tsujikawa 2011-10-22 22:43:07 +09:00
parent c8ed44b18f
commit 1872aef953
5 changed files with 19 additions and 3 deletions

View File

@ -2849,9 +2849,14 @@ Description
+++++++++++ +++++++++++
This method changes global options dynamically. 'options' is of type This method changes global options dynamically. 'options' is of type
struct and the available options are *<<aria2_optref_max_concurrent_downloads, max-concurrent-downloads>>*, struct and the available options are
*<<aria2_optref_max_overall_download_limit, max-overall-download-limit>>*, *<<aria2_optref_max_overall_upload_limit, max-overall-upload-limit>>*, *<<aria2_optref_log_level, log-level>>* *<<aria2_optref_max_concurrent_downloads, max-concurrent-downloads>>*,
and *<<aria2_optref_log, log>>*. Using *<<aria2_optref_log, log>>* option, you can dynamically start logging or *<<aria2_optref_max_download_result, max-download-result>>*,
*<<aria2_optref_max_overall_download_limit, max-overall-download-limit>>*,
*<<aria2_optref_max_overall_upload_limit, max-overall-upload-limit>>*,
*<<aria2_optref_log_level, log-level>>*
and *<<aria2_optref_log, log>>*.
Using *<<aria2_optref_log, log>>* option, you can dynamically start logging or
change log file. To stop logging, give empty string("") as a parameter change log file. To stop logging, give empty string("") as a parameter
value. Note that log file is always opened in append mode. This method value. Note that log file is always opened in append mode. This method
returns "OK" for success. returns "OK" for success.

View File

@ -226,6 +226,7 @@ OptionParser.new do |opt|
opt.on("--max-overall-upload-limit LIMIT"){|val| options["max-overall-upload-limit"]=val} opt.on("--max-overall-upload-limit LIMIT"){|val| options["max-overall-upload-limit"]=val}
opt.on("-j","--max-concurrent-downloads N"){|val| options["max-concurrent-downloads"]=val} opt.on("-j","--max-concurrent-downloads N"){|val| options["max-concurrent-downloads"]=val}
opt.on("-l","--log FILE"){|val| options["log"]=val} opt.on("-l","--log FILE"){|val| options["log"]=val}
opt.on("--max-download-result NUM"){|val| options["max-download-result"]=val}
opt.on("--server SERVER", "hostname of XML-RPC server. Default: localhost"){|val| options["server"]=val } opt.on("--server SERVER", "hostname of XML-RPC server. Default: localhost"){|val| options["server"]=val }
opt.on("--port PORT", "port of XML-RPC server. Default: 6800"){|val| options["port"]=val } opt.on("--port PORT", "port of XML-RPC server. Default: 6800"){|val| options["port"]=val }

View File

@ -432,6 +432,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
"1000", "1000",
0)); 0));
op->addTag(TAG_ADVANCED); op->addTag(TAG_ADVANCED);
op->setChangeGlobalOption(true);
handlers.push_back(op); handlers.push_back(op);
} }
{ {

View File

@ -304,6 +304,11 @@ public:
{ {
return serverStatMan_; return serverStatMan_;
} }
void setMaxDownloadResult(size_t v)
{
maxDownloadResult_ = v;
}
}; };
typedef SharedHandle<RequestGroupMan> RequestGroupManHandle; typedef SharedHandle<RequestGroupMan> RequestGroupManHandle;

View File

@ -1170,6 +1170,10 @@ SharedHandle<ValueBase> ChangeGlobalOptionRpcMethod::process
(option.getAsInt(PREF_MAX_CONCURRENT_DOWNLOADS)); (option.getAsInt(PREF_MAX_CONCURRENT_DOWNLOADS));
e->getRequestGroupMan()->requestQueueCheck(); e->getRequestGroupMan()->requestQueueCheck();
} }
if(option.defined(PREF_MAX_DOWNLOAD_RESULT)) {
e->getRequestGroupMan()->setMaxDownloadResult
(option.getAsInt(PREF_MAX_DOWNLOAD_RESULT));
}
if(option.defined(PREF_LOG_LEVEL)) { if(option.defined(PREF_LOG_LEVEL)) {
LogFactory::setLogLevel(option.get(PREF_LOG_LEVEL)); LogFactory::setLogLevel(option.get(PREF_LOG_LEVEL));
} }