Made --uri-selector option available in -i list.

pull/2/head
Tatsuhiro Tsujikawa 2011-10-22 21:49:46 +09:00
parent 6bc6825cec
commit c8ed44b18f
4 changed files with 11 additions and 7 deletions

View File

@ -1613,6 +1613,7 @@ of URIs. These optional lines must start with white space(s).
* *<<aria2_optref_hash_check_only, hash-check-only>>*
* *<<aria2_optref_checksum, checksum>>*
* *<<aria2_optref_piece_length, piece_length>>*
* *<<aria2_optref_uri_selector, uri-selector>>*
These options have exactly same meaning of the ones in the
command-line options, but it just applies to the URIs it belongs to.

View File

@ -220,6 +220,7 @@ OptionParser.new do |opt|
}
opt.on("--checksum TYPE_DIGEST"){|val| options["checksum"]=val}
opt.on("--piece-length LENGTH"){|val| options["piece-length"]=val}
opt.on("--uri-selector SELECTOR"){|val| options["uri-selector"]=val}
opt.on("--max-overall-download-limit LIMIT"){|val| options["max-overall-download-limit"]=val}
opt.on("--max-overall-upload-limit LIMIT"){|val| options["max-overall-upload-limit"]=val}

View File

@ -930,6 +930,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
(vbegin(params), vend(params))));
op->addTag(TAG_FTP);
op->addTag(TAG_HTTP);
op->setInitialOption(true);
handlers.push_back(op);
}
// HTTP Specific Options

View File

@ -454,16 +454,17 @@ void RequestGroupMan::removeStoppedGroup(DownloadEngine* e)
void RequestGroupMan::configureRequestGroup
(const SharedHandle<RequestGroup>& requestGroup) const
{
const std::string& uriSelectorValue = option_->get(PREF_URI_SELECTOR);
const std::string& uriSelectorValue =
requestGroup->getOption()->get(PREF_URI_SELECTOR);
SharedHandle<URISelector> sel;
if(uriSelectorValue == V_FEEDBACK) {
SharedHandle<URISelector> sel(new FeedbackURISelector(serverStatMan_));
requestGroup->setURISelector(sel);
sel.reset(new FeedbackURISelector(serverStatMan_));
} else if(uriSelectorValue == V_INORDER) {
SharedHandle<URISelector> sel(new InorderURISelector());
requestGroup->setURISelector(sel);
sel.reset(new InorderURISelector());
} else if(uriSelectorValue == V_ADAPTIVE) {
SharedHandle<URISelector> sel(new AdaptiveURISelector(serverStatMan_,
requestGroup.get()));
sel.reset(new AdaptiveURISelector(serverStatMan_, requestGroup.get()));
}
if(sel) {
requestGroup->setURISelector(sel);
}
}