--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.
pull/2/head
Tatsuhiro Tsujikawa 2011-11-02 00:27:31 +09:00
parent f884ad8339
commit 1a418b518c
2 changed files with 15 additions and 0 deletions

View File

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

View File

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