Forráskód Böngészése

--index-out option is now available in aria2.changeOption.

--index-out option is now available in aria2.changeOption if a
download is waiting/paused in queue.
Tatsuhiro Tsujikawa 14 éve
szülő
commit
1a418b518c
2 módosított fájl, 15 hozzáadás és 0 törlés
  1. 1 0
      src/OptionHandlerFactory.cc
  2. 14 0
      src/RpcMethodImpl.cc

+ 1 - 0
src/OptionHandlerFactory.cc

@@ -1883,6 +1883,7 @@ OptionHandlerFactory::createOptionHandlers()
     op->addTag(TAG_BITTORRENT);
     op->setInitialOption(true);
     op->setCumulative(true);
+    op->setChangeOptionForReserved(true);
     handlers.push_back(op);
   }
   {

+ 14 - 0
src/RpcMethodImpl.cc

@@ -36,6 +36,7 @@
 
 #include <cassert>
 #include <algorithm>
+#include <sstream>
 
 #include "Logger.h"
 #include "LogFactory.h"
@@ -1156,6 +1157,19 @@ void changeOption
                         group->getOption()->get(PREF_OUT)));
     }
   }
+  if(option.defined(PREF_DIR) || option.defined(PREF_INDEX_OUT)) {
+    if(dctx->hasAttribute(bittorrent::BITTORRENT)) {
+      std::istringstream indexOutIn(group->getOption()->get(PREF_INDEX_OUT));
+      std::vector<std::pair<size_t, std::string> > indexPaths =
+        util::createIndexPaths(indexOutIn);
+      for(std::vector<std::pair<size_t, std::string> >::const_iterator i =
+            indexPaths.begin(), eoi = indexPaths.end(); i != eoi; ++i) {
+        dctx->setFilePathWithIndex
+          ((*i).first,
+           util::applyDir(group->getOption()->get(PREF_DIR), (*i).second));
+      }
+    }
+  }
   if(option.defined(PREF_MAX_DOWNLOAD_LIMIT)) {
     group->setMaxDownloadSpeedLimit
       (option.getAsInt(PREF_MAX_DOWNLOAD_LIMIT));