mirror of https://github.com/aria2/aria2
Deprecated --enable-xml-rpc and --xml-rpc-* option. Introduced
--enable-rpc and --rpc-* option instead. --enable-xml-rpc and --xml-rpc-* option can be used but warning message will be shown. The help tag #xml-rpc was replaced with #rpc.pull/1/head
parent
f0cfbb21c1
commit
3ddb68f340
|
@ -163,13 +163,13 @@ DownloadEngineFactory::newDownloadEngine
|
||||||
stopSec));
|
stopSec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(op->getAsBool(PREF_ENABLE_XML_RPC)) {
|
if(op->getAsBool(PREF_ENABLE_RPC)) {
|
||||||
static int families[] = { AF_INET, AF_INET6 };
|
static int families[] = { AF_INET, AF_INET6 };
|
||||||
size_t familiesLength = op->getAsBool(PREF_DISABLE_IPV6)?1:2;
|
size_t familiesLength = op->getAsBool(PREF_DISABLE_IPV6)?1:2;
|
||||||
for(size_t i = 0; i < familiesLength; ++i) {
|
for(size_t i = 0; i < familiesLength; ++i) {
|
||||||
HttpListenCommand* httpListenCommand =
|
HttpListenCommand* httpListenCommand =
|
||||||
new HttpListenCommand(e->newCUID(), e.get(), families[i]);
|
new HttpListenCommand(e->newCUID(), e.get(), families[i]);
|
||||||
if(httpListenCommand->bindPort(op->getAsInt(PREF_XML_RPC_LISTEN_PORT))){
|
if(httpListenCommand->bindPort(op->getAsInt(PREF_RPC_LISTEN_PORT))){
|
||||||
e->addRoutineCommand(httpListenCommand);
|
e->addRoutineCommand(httpListenCommand);
|
||||||
} else {
|
} else {
|
||||||
delete httpListenCommand;
|
delete httpListenCommand;
|
||||||
|
|
|
@ -102,7 +102,7 @@ bool HttpListenCommand::bindPort(uint16_t port)
|
||||||
family_ == AF_INET?4:6));
|
family_ == AF_INET?4:6));
|
||||||
try {
|
try {
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
if(e_->getOption()->getAsBool(PREF_XML_RPC_LISTEN_ALL)) {
|
if(e_->getOption()->getAsBool(PREF_RPC_LISTEN_ALL)) {
|
||||||
flags = AI_PASSIVE;
|
flags = AI_PASSIVE;
|
||||||
}
|
}
|
||||||
serverSocket_->bind(A2STR::NIL, port, family_, flags);
|
serverSocket_->bind(A2STR::NIL, port, family_, flags);
|
||||||
|
|
|
@ -64,8 +64,8 @@ HttpServerCommand::HttpServerCommand
|
||||||
{
|
{
|
||||||
setStatus(Command::STATUS_ONESHOT_REALTIME);
|
setStatus(Command::STATUS_ONESHOT_REALTIME);
|
||||||
e_->addSocketForReadCheck(socket_, this);
|
e_->addSocketForReadCheck(socket_, this);
|
||||||
httpServer_->setUsernamePassword(e_->getOption()->get(PREF_XML_RPC_USER),
|
httpServer_->setUsernamePassword(e_->getOption()->get(PREF_RPC_USER),
|
||||||
e_->getOption()->get(PREF_XML_RPC_PASSWD));
|
e_->getOption()->get(PREF_RPC_PASSWD));
|
||||||
#ifdef HAVE_ZLIB
|
#ifdef HAVE_ZLIB
|
||||||
httpServer_->enableGZip();
|
httpServer_->enableGZip();
|
||||||
#else // !HAVE_ZLIB
|
#else // !HAVE_ZLIB
|
||||||
|
@ -130,7 +130,7 @@ bool HttpServerCommand::execute()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(static_cast<uint64_t>
|
if(static_cast<uint64_t>
|
||||||
(e_->getOption()->getAsInt(PREF_XML_RPC_MAX_REQUEST_SIZE)) <
|
(e_->getOption()->getAsInt(PREF_RPC_MAX_REQUEST_SIZE)) <
|
||||||
httpServer_->getContentLength()) {
|
httpServer_->getContentLength()) {
|
||||||
A2_LOG_INFO(fmt("Request too long. ContentLength=%s."
|
A2_LOG_INFO(fmt("Request too long. ContentLength=%s."
|
||||||
" See --xml-rpc-max-request-size option to loose"
|
" See --xml-rpc-max-request-size option to loose"
|
||||||
|
|
|
@ -230,11 +230,24 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
#endif // ENABLE_DIRECT_IO
|
#endif // ENABLE_DIRECT_IO
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_XML_RPC,
|
(PREF_ENABLE_RPC,
|
||||||
TEXT_ENABLE_XML_RPC,
|
TEXT_ENABLE_RPC,
|
||||||
A2_V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_RPC);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// TODO Deprecated
|
||||||
|
SharedHandle<OptionHandler> op
|
||||||
|
(new DeprecatedOptionHandler
|
||||||
|
(SharedHandle<OptionHandler>(new BooleanOptionHandler
|
||||||
|
(PREF_ENABLE_XML_RPC,
|
||||||
|
TEXT_ENABLE_XML_RPC,
|
||||||
|
NO_DEFAULT_VALUE,
|
||||||
|
OptionHandler::OPT_ARG)),
|
||||||
|
PREF_ENABLE_RPC));
|
||||||
|
op->addTag(TAG_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -568,43 +581,104 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_XML_RPC_LISTEN_ALL,
|
(PREF_RPC_LISTEN_ALL,
|
||||||
TEXT_XML_RPC_LISTEN_ALL,
|
TEXT_RPC_LISTEN_ALL,
|
||||||
A2_V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new NumberOptionHandler
|
SharedHandle<OptionHandler> op(new NumberOptionHandler
|
||||||
(PREF_XML_RPC_LISTEN_PORT,
|
(PREF_RPC_LISTEN_PORT,
|
||||||
TEXT_XML_RPC_LISTEN_PORT,
|
TEXT_RPC_LISTEN_PORT,
|
||||||
"6800",
|
"6800",
|
||||||
1024, UINT16_MAX));
|
1024, UINT16_MAX));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new UnitNumberOptionHandler
|
SharedHandle<OptionHandler> op(new UnitNumberOptionHandler
|
||||||
(PREF_XML_RPC_MAX_REQUEST_SIZE,
|
(PREF_RPC_MAX_REQUEST_SIZE,
|
||||||
TEXT_XML_RPC_MAX_REQUEST_SIZE,
|
TEXT_RPC_MAX_REQUEST_SIZE,
|
||||||
"2M",
|
"2M",
|
||||||
0));
|
0));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
||||||
(PREF_XML_RPC_USER,
|
(PREF_RPC_USER,
|
||||||
TEXT_XML_RPC_USER));
|
TEXT_RPC_USER));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
||||||
(PREF_XML_RPC_PASSWD,
|
(PREF_RPC_PASSWD,
|
||||||
TEXT_XML_RPC_PASSWD));
|
TEXT_RPC_PASSWD));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_RPC);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// TODO Deprecated
|
||||||
|
SharedHandle<OptionHandler> op
|
||||||
|
(new DeprecatedOptionHandler
|
||||||
|
(SharedHandle<OptionHandler>(new BooleanOptionHandler
|
||||||
|
(PREF_XML_RPC_LISTEN_ALL,
|
||||||
|
TEXT_XML_RPC_LISTEN_ALL,
|
||||||
|
NO_DEFAULT_VALUE,
|
||||||
|
OptionHandler::OPT_ARG)),
|
||||||
|
PREF_RPC_LISTEN_ALL));
|
||||||
|
op->addTag(TAG_RPC);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// TODO Deprecated
|
||||||
|
SharedHandle<OptionHandler> op
|
||||||
|
(new DeprecatedOptionHandler
|
||||||
|
(SharedHandle<OptionHandler>(new NumberOptionHandler
|
||||||
|
(PREF_XML_RPC_LISTEN_PORT,
|
||||||
|
TEXT_XML_RPC_LISTEN_PORT,
|
||||||
|
NO_DEFAULT_VALUE,
|
||||||
|
1024, UINT16_MAX)),
|
||||||
|
PREF_RPC_LISTEN_PORT));
|
||||||
|
op->addTag(TAG_RPC);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// TODO Deprecated
|
||||||
|
SharedHandle<OptionHandler> op
|
||||||
|
(new DeprecatedOptionHandler
|
||||||
|
(SharedHandle<OptionHandler>(new UnitNumberOptionHandler
|
||||||
|
(PREF_XML_RPC_MAX_REQUEST_SIZE,
|
||||||
|
TEXT_XML_RPC_MAX_REQUEST_SIZE,
|
||||||
|
NO_DEFAULT_VALUE,
|
||||||
|
0)),
|
||||||
|
PREF_RPC_MAX_REQUEST_SIZE));
|
||||||
|
op->addTag(TAG_RPC);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// TODO Deprecated
|
||||||
|
SharedHandle<OptionHandler> op
|
||||||
|
(new DeprecatedOptionHandler
|
||||||
|
(SharedHandle<OptionHandler>(new DefaultOptionHandler
|
||||||
|
(PREF_XML_RPC_USER,
|
||||||
|
TEXT_XML_RPC_USER)),
|
||||||
|
PREF_RPC_USER));
|
||||||
|
op->addTag(TAG_RPC);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
// TODO Deprecated
|
||||||
|
SharedHandle<OptionHandler> op
|
||||||
|
(new DeprecatedOptionHandler
|
||||||
|
(SharedHandle<OptionHandler>(new DefaultOptionHandler
|
||||||
|
(PREF_XML_RPC_PASSWD,
|
||||||
|
TEXT_XML_RPC_PASSWD)),
|
||||||
|
PREF_RPC_PASSWD));
|
||||||
|
op->addTag(TAG_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
// HTTP/FTP options
|
// HTTP/FTP options
|
||||||
|
@ -1689,7 +1763,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
TAG_COOKIE,
|
TAG_COOKIE,
|
||||||
TAG_HOOK,
|
TAG_HOOK,
|
||||||
TAG_FILE,
|
TAG_FILE,
|
||||||
TAG_XML_RPC,
|
TAG_RPC,
|
||||||
TAG_EXPERIMENTAL,
|
TAG_EXPERIMENTAL,
|
||||||
TAG_HELP,
|
TAG_HELP,
|
||||||
TAG_ALL
|
TAG_ALL
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "FileEntry.h"
|
#include "FileEntry.h"
|
||||||
#include "a2io.h"
|
#include "a2io.h"
|
||||||
|
#include "LogFactory.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -728,4 +729,89 @@ std::string PrioritizePieceOptionHandler::createPossibleValuesString() const
|
||||||
return "head[=SIZE], tail[=SIZE]";
|
return "head[=SIZE], tail[=SIZE]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeprecatedOptionHandler::DeprecatedOptionHandler
|
||||||
|
(const SharedHandle<OptionHandler>& depOptHandler,
|
||||||
|
const std::string& repOptName)
|
||||||
|
: depOptHandler_(depOptHandler), repOptName_(repOptName)
|
||||||
|
{}
|
||||||
|
|
||||||
|
bool DeprecatedOptionHandler::canHandle(const std::string& optName)
|
||||||
|
{
|
||||||
|
return depOptHandler_->canHandle(optName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeprecatedOptionHandler::parse(Option& option, const std::string& arg)
|
||||||
|
{
|
||||||
|
A2_LOG_WARN(fmt("--%s option is deprecated. Use --%s option instead.",
|
||||||
|
depOptHandler_->getName().c_str(),
|
||||||
|
repOptName_.c_str()));
|
||||||
|
depOptHandler_->parse(option, arg);
|
||||||
|
option.put(repOptName_, option.get(depOptHandler_->getName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DeprecatedOptionHandler::createPossibleValuesString() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->createPossibleValuesString();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DeprecatedOptionHandler::hasTag(const std::string& tag) const
|
||||||
|
{
|
||||||
|
return depOptHandler_->hasTag(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeprecatedOptionHandler::addTag(const std::string& tag)
|
||||||
|
{
|
||||||
|
depOptHandler_->addTag(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DeprecatedOptionHandler::toTagString() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->toTagString();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& DeprecatedOptionHandler::getName() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& DeprecatedOptionHandler::getDescription() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->getDescription();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& DeprecatedOptionHandler::getDefaultValue() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->getDefaultValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DeprecatedOptionHandler::isHidden() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->isHidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeprecatedOptionHandler::hide()
|
||||||
|
{
|
||||||
|
depOptHandler_->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionHandler::ARG_TYPE DeprecatedOptionHandler::getArgType() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->getArgType();
|
||||||
|
}
|
||||||
|
|
||||||
|
char DeprecatedOptionHandler::getShortName() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->getShortName();
|
||||||
|
}
|
||||||
|
|
||||||
|
int DeprecatedOptionHandler::getOptionID() const
|
||||||
|
{
|
||||||
|
return depOptHandler_->getOptionID();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeprecatedOptionHandler::setOptionID(int id)
|
||||||
|
{
|
||||||
|
depOptHandler_->setOptionID(id);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -292,6 +292,31 @@ public:
|
||||||
virtual std::string createPossibleValuesString() const;
|
virtual std::string createPossibleValuesString() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DeprecatedOptionHandler:public OptionHandler {
|
||||||
|
private:
|
||||||
|
SharedHandle<OptionHandler> depOptHandler_;
|
||||||
|
std::string repOptName_;
|
||||||
|
public:
|
||||||
|
DeprecatedOptionHandler
|
||||||
|
(const SharedHandle<OptionHandler>& depOptHandler,
|
||||||
|
const std::string& repOptName);
|
||||||
|
virtual bool canHandle(const std::string& optName);
|
||||||
|
virtual void parse(Option& option, const std::string& arg);
|
||||||
|
virtual std::string createPossibleValuesString() const;
|
||||||
|
virtual bool hasTag(const std::string& tag) const;
|
||||||
|
virtual void addTag(const std::string& tag);
|
||||||
|
virtual std::string toTagString() const;
|
||||||
|
virtual const std::string& getName() const;
|
||||||
|
virtual const std::string& getDescription() const;
|
||||||
|
virtual const std::string& getDefaultValue() const;
|
||||||
|
virtual bool isHidden() const;
|
||||||
|
virtual void hide();
|
||||||
|
virtual ARG_TYPE getArgType() const;
|
||||||
|
virtual char getShortName() const;
|
||||||
|
virtual int getOptionID() const;
|
||||||
|
virtual void setOptionID(int id);
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
||||||
#endif // D_OPTION_HANDLER_IMPL_H
|
#endif // D_OPTION_HANDLER_IMPL_H
|
||||||
|
|
|
@ -89,7 +89,7 @@ RequestGroupMan::RequestGroupMan
|
||||||
(option->getAsInt(PREF_MAX_OVERALL_DOWNLOAD_LIMIT)),
|
(option->getAsInt(PREF_MAX_OVERALL_DOWNLOAD_LIMIT)),
|
||||||
maxOverallUploadSpeedLimit_(option->getAsInt
|
maxOverallUploadSpeedLimit_(option->getAsInt
|
||||||
(PREF_MAX_OVERALL_UPLOAD_LIMIT)),
|
(PREF_MAX_OVERALL_UPLOAD_LIMIT)),
|
||||||
xmlRpc_(option->getAsBool(PREF_ENABLE_XML_RPC)),
|
rpc_(option->getAsBool(PREF_ENABLE_RPC)),
|
||||||
queueCheck_(true),
|
queueCheck_(true),
|
||||||
removedErrorResult_(0),
|
removedErrorResult_(0),
|
||||||
removedLastErrorResult_(error_code::FINISHED),
|
removedLastErrorResult_(error_code::FINISHED),
|
||||||
|
@ -100,7 +100,7 @@ RequestGroupMan::~RequestGroupMan() {}
|
||||||
|
|
||||||
bool RequestGroupMan::downloadFinished()
|
bool RequestGroupMan::downloadFinished()
|
||||||
{
|
{
|
||||||
if(xmlRpc_) {
|
if(rpc_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return requestGroups_.empty() && reservedGroups_.empty();
|
return requestGroups_.empty() && reservedGroups_.empty();
|
||||||
|
|
|
@ -71,8 +71,8 @@ private:
|
||||||
|
|
||||||
unsigned int maxOverallUploadSpeedLimit_;
|
unsigned int maxOverallUploadSpeedLimit_;
|
||||||
|
|
||||||
// truf if XML-RPC is enabled.
|
// true if JSON-RPC/XML-RPC is enabled.
|
||||||
bool xmlRpc_;
|
bool rpc_;
|
||||||
|
|
||||||
bool queueCheck_;
|
bool queueCheck_;
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#define TAG_COOKIE "#cookie"
|
#define TAG_COOKIE "#cookie"
|
||||||
#define TAG_HOOK "#hook"
|
#define TAG_HOOK "#hook"
|
||||||
#define TAG_FILE "#file"
|
#define TAG_FILE "#file"
|
||||||
#define TAG_XML_RPC "#xml-rpc"
|
#define TAG_RPC "#rpc"
|
||||||
#define TAG_EXPERIMENTAL "#experimental"
|
#define TAG_EXPERIMENTAL "#experimental"
|
||||||
#define TAG_HELP "#help"
|
#define TAG_HELP "#help"
|
||||||
#define TAG_ALL "#all"
|
#define TAG_ALL "#all"
|
||||||
|
|
|
@ -262,7 +262,7 @@ error_code::Value main(int argc, char* argv[])
|
||||||
op->remove(PREF_INPUT_FILE);
|
op->remove(PREF_INPUT_FILE);
|
||||||
op->remove(PREF_INDEX_OUT);
|
op->remove(PREF_INDEX_OUT);
|
||||||
op->remove(PREF_SELECT_FILE);
|
op->remove(PREF_SELECT_FILE);
|
||||||
if(!op->getAsBool(PREF_ENABLE_XML_RPC) && requestGroups.empty()) {
|
if(!op->getAsBool(PREF_ENABLE_RPC) && requestGroups.empty()) {
|
||||||
std::cout << MSG_NO_FILES_TO_DOWNLOAD << std::endl;
|
std::cout << MSG_NO_FILES_TO_DOWNLOAD << std::endl;
|
||||||
} else {
|
} else {
|
||||||
exitStatus = MultiUrlRequestInfo(requestGroups, op, getStatCalc(op),
|
exitStatus = MultiUrlRequestInfo(requestGroups, op, getStatCalc(op),
|
||||||
|
|
|
@ -184,7 +184,7 @@ void option_processing(Option& op, std::vector<std::string>& uris,
|
||||||
showUsage(TAG_HELP, oparser);
|
showUsage(TAG_HELP, oparser);
|
||||||
exit(e.getErrorCode());
|
exit(e.getErrorCode());
|
||||||
}
|
}
|
||||||
if(!op.getAsBool(PREF_ENABLE_XML_RPC) &&
|
if(!op.getAsBool(PREF_ENABLE_RPC) &&
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
op.blank(PREF_TORRENT_FILE) &&
|
op.blank(PREF_TORRENT_FILE) &&
|
||||||
#endif // ENABLE_BITTORRENT
|
#endif // ENABLE_BITTORRENT
|
||||||
|
|
26
src/prefs.cc
26
src/prefs.cc
|
@ -154,28 +154,40 @@ const std::string V_KQUEUE("kqueue");
|
||||||
const std::string V_PORT("port");
|
const std::string V_PORT("port");
|
||||||
const std::string V_POLL("poll");
|
const std::string V_POLL("poll");
|
||||||
const std::string V_SELECT("select");
|
const std::string V_SELECT("select");
|
||||||
|
// value: true | false
|
||||||
|
const std::string PREF_ENABLE_RPC("enable-rpc");
|
||||||
// value: 1*digit
|
// value: 1*digit
|
||||||
const std::string PREF_XML_RPC_LISTEN_PORT("xml-rpc-listen-port");
|
const std::string PREF_RPC_LISTEN_PORT("rpc-listen-port");
|
||||||
|
// value: string
|
||||||
|
const std::string PREF_RPC_USER("rpc-user");
|
||||||
|
// value: string
|
||||||
|
const std::string PREF_RPC_PASSWD("rpc-passwd");
|
||||||
|
// value: 1*digit
|
||||||
|
const std::string PREF_RPC_MAX_REQUEST_SIZE("rpc-max-request-size");
|
||||||
|
// value: true | false
|
||||||
|
const std::string PREF_RPC_LISTEN_ALL("rpc-listen-all");
|
||||||
// value: true | false
|
// value: true | false
|
||||||
const std::string PREF_ENABLE_XML_RPC("enable-xml-rpc");
|
const std::string PREF_ENABLE_XML_RPC("enable-xml-rpc");
|
||||||
// value: true | false
|
// value: 1*digit
|
||||||
const std::string PREF_DRY_RUN("dry-run");
|
const std::string PREF_XML_RPC_LISTEN_PORT("xml-rpc-listen-port");
|
||||||
// value: true | false
|
|
||||||
const std::string PREF_REUSE_URI("reuse-uri");
|
|
||||||
// value: string
|
// value: string
|
||||||
const std::string PREF_XML_RPC_USER("xml-rpc-user");
|
const std::string PREF_XML_RPC_USER("xml-rpc-user");
|
||||||
// value: string
|
// value: string
|
||||||
const std::string PREF_XML_RPC_PASSWD("xml-rpc-passwd");
|
const std::string PREF_XML_RPC_PASSWD("xml-rpc-passwd");
|
||||||
// value: 1*digit
|
// value: 1*digit
|
||||||
const std::string PREF_XML_RPC_MAX_REQUEST_SIZE("xml-rpc-max-request-size");
|
const std::string PREF_XML_RPC_MAX_REQUEST_SIZE("xml-rpc-max-request-size");
|
||||||
|
// value: true | false
|
||||||
|
const std::string PREF_XML_RPC_LISTEN_ALL("xml-rpc-listen-all");
|
||||||
|
// value: true | false
|
||||||
|
const std::string PREF_DRY_RUN("dry-run");
|
||||||
|
// value: true | false
|
||||||
|
const std::string PREF_REUSE_URI("reuse-uri");
|
||||||
// value: string
|
// value: string
|
||||||
const std::string PREF_ON_DOWNLOAD_START("on-download-start");
|
const std::string PREF_ON_DOWNLOAD_START("on-download-start");
|
||||||
const std::string PREF_ON_DOWNLOAD_PAUSE("on-download-pause");
|
const std::string PREF_ON_DOWNLOAD_PAUSE("on-download-pause");
|
||||||
const std::string PREF_ON_DOWNLOAD_STOP("on-download-stop");
|
const std::string PREF_ON_DOWNLOAD_STOP("on-download-stop");
|
||||||
const std::string PREF_ON_DOWNLOAD_COMPLETE("on-download-complete");
|
const std::string PREF_ON_DOWNLOAD_COMPLETE("on-download-complete");
|
||||||
const std::string PREF_ON_DOWNLOAD_ERROR("on-download-error");
|
const std::string PREF_ON_DOWNLOAD_ERROR("on-download-error");
|
||||||
// value: true | false
|
|
||||||
const std::string PREF_XML_RPC_LISTEN_ALL("xml-rpc-listen-all");
|
|
||||||
// value: string
|
// value: string
|
||||||
const std::string PREF_INTERFACE("interface");
|
const std::string PREF_INTERFACE("interface");
|
||||||
// value: true | false
|
// value: true | false
|
||||||
|
|
26
src/prefs.h
26
src/prefs.h
|
@ -158,28 +158,40 @@ extern const std::string V_KQUEUE;
|
||||||
extern const std::string V_PORT;
|
extern const std::string V_PORT;
|
||||||
extern const std::string V_POLL;
|
extern const std::string V_POLL;
|
||||||
extern const std::string V_SELECT;
|
extern const std::string V_SELECT;
|
||||||
|
// value: true | false
|
||||||
|
extern const std::string PREF_ENABLE_RPC;
|
||||||
// value: 1*digit
|
// value: 1*digit
|
||||||
extern const std::string PREF_XML_RPC_LISTEN_PORT;
|
extern const std::string PREF_RPC_LISTEN_PORT;
|
||||||
|
// value: string
|
||||||
|
extern const std::string PREF_RPC_USER;
|
||||||
|
// value: string
|
||||||
|
extern const std::string PREF_RPC_PASSWD;
|
||||||
|
// value: 1*digit
|
||||||
|
extern const std::string PREF_RPC_MAX_REQUEST_SIZE;
|
||||||
|
// value: true | false
|
||||||
|
extern const std::string PREF_RPC_LISTEN_ALL;
|
||||||
// value: true | false
|
// value: true | false
|
||||||
extern const std::string PREF_ENABLE_XML_RPC;
|
extern const std::string PREF_ENABLE_XML_RPC;
|
||||||
// value: true | false
|
// value: 1*digit
|
||||||
extern const std::string PREF_DRY_RUN;
|
extern const std::string PREF_XML_RPC_LISTEN_PORT;
|
||||||
// value: true | false
|
|
||||||
extern const std::string PREF_REUSE_URI;
|
|
||||||
// value: string
|
// value: string
|
||||||
extern const std::string PREF_XML_RPC_USER;
|
extern const std::string PREF_XML_RPC_USER;
|
||||||
// value: string
|
// value: string
|
||||||
extern const std::string PREF_XML_RPC_PASSWD;
|
extern const std::string PREF_XML_RPC_PASSWD;
|
||||||
// value: 1*digit
|
// value: 1*digit
|
||||||
extern const std::string PREF_XML_RPC_MAX_REQUEST_SIZE;
|
extern const std::string PREF_XML_RPC_MAX_REQUEST_SIZE;
|
||||||
|
// value: true | false
|
||||||
|
extern const std::string PREF_XML_RPC_LISTEN_ALL;
|
||||||
|
// value: true | false
|
||||||
|
extern const std::string PREF_DRY_RUN;
|
||||||
|
// value: true | false
|
||||||
|
extern const std::string PREF_REUSE_URI;
|
||||||
// value: string
|
// value: string
|
||||||
extern const std::string PREF_ON_DOWNLOAD_START;
|
extern const std::string PREF_ON_DOWNLOAD_START;
|
||||||
extern const std::string PREF_ON_DOWNLOAD_PAUSE;
|
extern const std::string PREF_ON_DOWNLOAD_PAUSE;
|
||||||
extern const std::string PREF_ON_DOWNLOAD_STOP;
|
extern const std::string PREF_ON_DOWNLOAD_STOP;
|
||||||
extern const std::string PREF_ON_DOWNLOAD_COMPLETE;
|
extern const std::string PREF_ON_DOWNLOAD_COMPLETE;
|
||||||
extern const std::string PREF_ON_DOWNLOAD_ERROR;
|
extern const std::string PREF_ON_DOWNLOAD_ERROR;
|
||||||
// value: true | false
|
|
||||||
extern const std::string PREF_XML_RPC_LISTEN_ALL;
|
|
||||||
// value: string
|
// value: string
|
||||||
extern const std::string PREF_INTERFACE;
|
extern const std::string PREF_INTERFACE;
|
||||||
// value: true | false
|
// value: true | false
|
||||||
|
|
|
@ -490,22 +490,6 @@
|
||||||
" server.")
|
" server.")
|
||||||
#define TEXT_EVENT_POLL \
|
#define TEXT_EVENT_POLL \
|
||||||
_(" --event-poll=POLL Specify the method for polling events.")
|
_(" --event-poll=POLL Specify the method for polling events.")
|
||||||
#define TEXT_XML_RPC_LISTEN_PORT \
|
|
||||||
_(" --xml-rpc-listen-port=PORT Specify a port number for XML-RPC server to listen\n" \
|
|
||||||
" to.")
|
|
||||||
#define TEXT_ENABLE_XML_RPC \
|
|
||||||
_(" --enable-xml-rpc[=true|false] Enable XML-RPC server.\n" \
|
|
||||||
" It is strongly recommended to set username and\n" \
|
|
||||||
" password using --xml-rpc-user and --xml-rpc-passwd\n" \
|
|
||||||
" option. See also --xml-rpc-listen-port option.")
|
|
||||||
#define TEXT_XML_RPC_MAX_REQUEST_SIZE \
|
|
||||||
_(" --xml-rpc-max-request-size=SIZE Set max size of XML-RPC request. If aria2\n" \
|
|
||||||
" detects the request is more than SIZE bytes, it\n" \
|
|
||||||
" drops connection.")
|
|
||||||
#define TEXT_XML_RPC_USER \
|
|
||||||
_(" --xml-rpc-user=USER Set XML-RPC user.")
|
|
||||||
#define TEXT_XML_RPC_PASSWD \
|
|
||||||
_(" --xml-rpc-passwd=PASSWD Set XML-RPC password.")
|
|
||||||
#define TEXT_BT_EXTERNAL_IP \
|
#define TEXT_BT_EXTERNAL_IP \
|
||||||
_(" --bt-external-ip=IPADDRESS Specify the external IP address to report to a\n" \
|
_(" --bt-external-ip=IPADDRESS Specify the external IP address to report to a\n" \
|
||||||
" BitTorrent tracker. Although this function is\n" \
|
" BitTorrent tracker. Although this function is\n" \
|
||||||
|
@ -574,10 +558,6 @@
|
||||||
_(" --bt-stop-timeout=SEC Stop BitTorrent download if download speed is 0 in\n" \
|
_(" --bt-stop-timeout=SEC Stop BitTorrent download if download speed is 0 in\n" \
|
||||||
" consecutive SEC seconds. If 0 is given, this\n" \
|
" consecutive SEC seconds. If 0 is given, this\n" \
|
||||||
" feature is disabled.")
|
" feature is disabled.")
|
||||||
#define TEXT_XML_RPC_LISTEN_ALL \
|
|
||||||
_(" --xml-rpc-listen-all[=true|false] Listen incoming XML-RPC requests on all\n" \
|
|
||||||
" network interfaces. If false is given, listen only\n" \
|
|
||||||
" on local loopback interface.")
|
|
||||||
#define TEXT_BT_PRIORITIZE_PIECE \
|
#define TEXT_BT_PRIORITIZE_PIECE \
|
||||||
_(" --bt-prioritize-piece=head[=SIZE],tail[=SIZE] Try to download first and last\n" \
|
_(" --bt-prioritize-piece=head[=SIZE],tail[=SIZE] Try to download first and last\n" \
|
||||||
" pieces of each file first. This is useful for\n" \
|
" pieces of each file first. This is useful for\n" \
|
||||||
|
@ -685,7 +665,7 @@
|
||||||
" You can pass this output file to aria2c with -i\n" \
|
" You can pass this output file to aria2c with -i\n" \
|
||||||
" option on restart. Please note that downloads\n" \
|
" option on restart. Please note that downloads\n" \
|
||||||
" added by aria2.addTorrent and aria2.addMetalink\n" \
|
" added by aria2.addTorrent and aria2.addMetalink\n" \
|
||||||
" XML-RPC method are not saved.")
|
" RPC method are not saved.")
|
||||||
#define TEXT_MAX_CONNECTION_PER_SERVER \
|
#define TEXT_MAX_CONNECTION_PER_SERVER \
|
||||||
_(" -x, --max-connection-per-server=NUM The maximum number of connections to one\n" \
|
_(" -x, --max-connection-per-server=NUM The maximum number of connections to one\n" \
|
||||||
" server for each download.")
|
" server for each download.")
|
||||||
|
@ -764,3 +744,36 @@
|
||||||
" option is useful when the system does not have\n" \
|
" option is useful when the system does not have\n" \
|
||||||
" /etc/resolv.conf and user does not have the\n" \
|
" /etc/resolv.conf and user does not have the\n" \
|
||||||
" permission to create it.")
|
" permission to create it.")
|
||||||
|
#define TEXT_ENABLE_RPC \
|
||||||
|
_(" --enable-rpc[=true|false] Enable JSON-RPC/XML-RPC server.\n" \
|
||||||
|
" It is strongly recommended to set username and\n" \
|
||||||
|
" password using --rpc-user and --rpc-passwd\n" \
|
||||||
|
" option. See also --rpc-listen-port option.")
|
||||||
|
#define TEXT_RPC_MAX_REQUEST_SIZE \
|
||||||
|
_(" --rpc-max-request-size=SIZE Set max size of JSON-RPC/XML-RPC request. If aria2\n" \
|
||||||
|
" detects the request is more than SIZE bytes, it\n" \
|
||||||
|
" drops connection.")
|
||||||
|
#define TEXT_RPC_USER \
|
||||||
|
_(" --rpc-user=USER Set JSON-RPC/XML-RPC user.")
|
||||||
|
#define TEXT_RPC_PASSWD \
|
||||||
|
_(" --rpc-passwd=PASSWD Set JSON-RPC/XML-RPC password.")
|
||||||
|
#define TEXT_RPC_LISTEN_ALL \
|
||||||
|
_(" --rpc-listen-all[=true|false] Listen incoming JSON-RPC/XML-RPC requests on all\n" \
|
||||||
|
" network interfaces. If false is given, listen only\n" \
|
||||||
|
" on local loopback interface.")
|
||||||
|
#define TEXT_RPC_LISTEN_PORT \
|
||||||
|
_(" --rpc-listen-port=PORT Specify a port number for JSON-RPC/XML-RPC server\n" \
|
||||||
|
" to listen to.")
|
||||||
|
#define TEXT_ENABLE_XML_RPC \
|
||||||
|
_(" --enable-xml-rpc[=true|false] Deprecated. Use --enable-rpc instead.")
|
||||||
|
#define TEXT_XML_RPC_MAX_REQUEST_SIZE \
|
||||||
|
_(" --xml-rpc-max-request-size=SIZE Deprecated. Use --rpc-max-request-size\n" \
|
||||||
|
" instead.")
|
||||||
|
#define TEXT_XML_RPC_USER \
|
||||||
|
_(" --xml-rpc-user=USER Deprecated. Use --rpc-user instead.")
|
||||||
|
#define TEXT_XML_RPC_PASSWD \
|
||||||
|
_(" --xml-rpc-passwd=PASSWD Deprecated. Use --rpc-passwd instead.")
|
||||||
|
#define TEXT_XML_RPC_LISTEN_ALL \
|
||||||
|
_(" --xml-rpc-listen-all[=true|false] Deprecated. Use --rpc-listen-all instead.")
|
||||||
|
#define TEXT_XML_RPC_LISTEN_PORT \
|
||||||
|
_(" --xml-rpc-listen-port=PORT Deprecated. Use --rpc-listen-port instead.")
|
||||||
|
|
Loading…
Reference in New Issue