Browse Source

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

Tatsuhiro Tsujikawa 14 years ago
parent
commit
1872aef953
5 changed files with 19 additions and 3 deletions
  1. 8 3
      doc/aria2c.1.asciidoc
  2. 1 0
      doc/xmlrpc/aria2rpc
  3. 1 0
      src/OptionHandlerFactory.cc
  4. 5 0
      src/RequestGroupMan.h
  5. 4 0
      src/RpcMethodImpl.cc

+ 8 - 3
doc/aria2c.1.asciidoc

@@ -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>>*,
-*<<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
+struct and the available options are
+*<<aria2_optref_max_concurrent_downloads, max-concurrent-downloads>>*,
+*<<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.

+ 1 - 0
doc/xmlrpc/aria2rpc

@@ -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 }

+ 1 - 0
src/OptionHandlerFactory.cc

@@ -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);
   }
   }
   {
   {

+ 5 - 0
src/RequestGroupMan.h

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

+ 4 - 0
src/RpcMethodImpl.cc

@@ -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));
   }
   }