Переглянути джерело

--max-connection-per-server option is now available in aria2.changeOption.

--max-connection-per-server option is now available in
aria2.changeOption if a download is waiting/paused in queue.
Tatsuhiro Tsujikawa 14 роки тому
батько
коміт
57b37db8a1
2 змінених файлів з 9 додано та 0 видалено
  1. 1 0
      src/OptionHandlerFactory.cc
  2. 8 0
      src/RpcMethodImpl.cc

+ 1 - 0
src/OptionHandlerFactory.cc

@@ -436,6 +436,7 @@ OptionHandlerFactory::createOptionHandlers()
     op->addTag(TAG_HTTP);
     op->setInitialOption(true);
     op->setChangeGlobalOption(true);
+    op->setChangeOptionForReserved(true);
     handlers.push_back(op);
   }
   {

+ 8 - 0
src/RpcMethodImpl.cc

@@ -1137,6 +1137,14 @@ void changeOption
   if(option.defined(PREF_SPLIT)) {
     group->setNumConcurrentCommand(option.getAsInt(PREF_SPLIT));
   }
+  if(option.defined(PREF_MAX_CONNECTION_PER_SERVER)) {
+    int maxConn = option.getAsInt(PREF_MAX_CONNECTION_PER_SERVER);
+    const std::vector<SharedHandle<FileEntry> >& files = dctx->getFileEntries();
+    for(std::vector<SharedHandle<FileEntry> >::const_iterator i = files.begin(),
+          eoi = files.end(); i != eoi; ++i) {
+      (*i)->setMaxConnectionPerServer(maxConn);
+    }
+  }
   if(option.defined(PREF_MAX_DOWNLOAD_LIMIT)) {
     group->setMaxDownloadSpeedLimit
       (option.getAsInt(PREF_MAX_DOWNLOAD_LIMIT));