浏览代码

--select-file option is now available in aria2.changeOption

--select-file option is now available in aria2.changeOption if a
download is waiting/paused in queue.
Tatsuhiro Tsujikawa 14 年之前
父节点
当前提交
1d9e673a68
共有 2 个文件被更改,包括 7 次插入0 次删除
  1. 1 0
      src/OptionHandlerFactory.cc
  2. 6 0
      src/RpcMethodImpl.cc

+ 1 - 0
src/OptionHandlerFactory.cc

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

+ 6 - 0
src/RpcMethodImpl.cc

@@ -1128,6 +1128,12 @@ void changeOption
     util::lowercase(p.second);
     dctx->setDigest(p.first, util::fromHex(p.second));
   }
+  if(option.defined(PREF_SELECT_FILE)) {
+    SegList<int> sgl;
+    util::parseIntSegments(sgl, option.get(PREF_SELECT_FILE));
+    sgl.normalize();
+    dctx->setFileFilter(sgl);
+  }
   if(option.defined(PREF_MAX_DOWNLOAD_LIMIT)) {
     group->setMaxDownloadSpeedLimit
       (option.getAsInt(PREF_MAX_DOWNLOAD_LIMIT));