mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced V_TRUE with A2_V_TRUE. Replaced V_FALSE with A2_V_FALSE. * src/AbstractCommand.cc * src/HttpResponseCommand.cc * src/Option.cc * src/OptionHandlerFactory.cc * src/OptionHandlerImpl.h * src/TrackerWatcherCommand.cc * src/download_helper.cc * src/main.cc * src/prefs.cc * src/prefs.h * test/AuthConfigFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DownloadHelperTest.cc * test/HttpRequestTest.cc * test/OptionHandlerTest.cc * test/UTMetadataPostDownloadHandlerTest.cc * test/XmlRpcMethodTest.cc
This commit is contained in:
parent
880c6b5498
commit
9eaf3ccb0f
18 changed files with 109 additions and 88 deletions
21
ChangeLog
21
ChangeLog
|
@ -1,3 +1,24 @@
|
||||||
|
2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Replaced V_TRUE with A2_V_TRUE. Replaced V_FALSE with A2_V_FALSE.
|
||||||
|
* src/AbstractCommand.cc
|
||||||
|
* src/HttpResponseCommand.cc
|
||||||
|
* src/Option.cc
|
||||||
|
* src/OptionHandlerFactory.cc
|
||||||
|
* src/OptionHandlerImpl.h
|
||||||
|
* src/TrackerWatcherCommand.cc
|
||||||
|
* src/download_helper.cc
|
||||||
|
* src/main.cc
|
||||||
|
* src/prefs.cc
|
||||||
|
* src/prefs.h
|
||||||
|
* test/AuthConfigFactoryTest.cc
|
||||||
|
* test/DefaultBtProgressInfoFileTest.cc
|
||||||
|
* test/DownloadHelperTest.cc
|
||||||
|
* test/HttpRequestTest.cc
|
||||||
|
* test/OptionHandlerTest.cc
|
||||||
|
* test/UTMetadataPostDownloadHandlerTest.cc
|
||||||
|
* test/XmlRpcMethodTest.cc
|
||||||
|
|
||||||
2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Updated autoconf 2.67
|
Updated autoconf 2.67
|
||||||
|
|
|
@ -426,9 +426,9 @@ void AbstractCommand::onAbort() {
|
||||||
("CUID#%s - Gathering URIs that has CANNOT_RESUME error",
|
("CUID#%s - Gathering URIs that has CANNOT_RESUME error",
|
||||||
util::itos(getCuid()).c_str());
|
util::itos(getCuid()).c_str());
|
||||||
}
|
}
|
||||||
// Set PREF_ALWAYS_RESUME to V_TRUE to avoid repeating this
|
// Set PREF_ALWAYS_RESUME to A2_V_TRUE to avoid repeating this
|
||||||
// process.
|
// process.
|
||||||
getOption()->put(PREF_ALWAYS_RESUME, V_TRUE);
|
getOption()->put(PREF_ALWAYS_RESUME, A2_V_TRUE);
|
||||||
std::deque<URIResult> res;
|
std::deque<URIResult> res;
|
||||||
fileEntry_->extractURIResult(res, downloadresultcode::CANNOT_RESUME);
|
fileEntry_->extractURIResult(res, downloadresultcode::CANNOT_RESUME);
|
||||||
if(!res.empty()) {
|
if(!res.empty()) {
|
||||||
|
|
|
@ -143,7 +143,7 @@ bool HttpResponseCommand::executeInternal()
|
||||||
} else if(httpResponse->getResponseStatus() == HttpHeader::S200 ||
|
} else if(httpResponse->getResponseStatus() == HttpHeader::S200 ||
|
||||||
httpResponse->getResponseStatus() == HttpHeader::S206) {
|
httpResponse->getResponseStatus() == HttpHeader::S206) {
|
||||||
// Remote file is newer than local file. We allow overwrite.
|
// Remote file is newer than local file. We allow overwrite.
|
||||||
getOption()->put(PREF_ALLOW_OVERWRITE, V_TRUE);
|
getOption()->put(PREF_ALLOW_OVERWRITE, A2_V_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(httpResponse->getResponseStatus() >= HttpHeader::S300 &&
|
if(httpResponse->getResponseStatus() >= HttpHeader::S300 &&
|
||||||
|
|
|
@ -87,7 +87,7 @@ int64_t Option::getAsLLInt(const std::string& name) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Option::getAsBool(const std::string& name) const {
|
bool Option::getAsBool(const std::string& name) const {
|
||||||
return get(name) == V_TRUE;
|
return get(name) == A2_V_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
double Option::getAsDouble(const std::string& name) const {
|
double Option::getAsDouble(const std::string& name) const {
|
||||||
|
|
|
@ -53,7 +53,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ALLOW_OVERWRITE,
|
(PREF_ALLOW_OVERWRITE,
|
||||||
TEXT_ALLOW_OVERWRITE,
|
TEXT_ALLOW_OVERWRITE,
|
||||||
V_FALSE));
|
A2_V_FALSE));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
op->addTag(TAG_FILE);
|
op->addTag(TAG_FILE);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -62,7 +62,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ALLOW_PIECE_LENGTH_CHANGE,
|
(PREF_ALLOW_PIECE_LENGTH_CHANGE,
|
||||||
TEXT_ALLOW_PIECE_LENGTH_CHANGE,
|
TEXT_ALLOW_PIECE_LENGTH_CHANGE,
|
||||||
V_FALSE));
|
A2_V_FALSE));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ALWAYS_RESUME,
|
(PREF_ALWAYS_RESUME,
|
||||||
TEXT_ALWAYS_RESUME,
|
TEXT_ALWAYS_RESUME,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
|
@ -82,7 +82,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ASYNC_DNS,
|
(PREF_ASYNC_DNS,
|
||||||
TEXT_ASYNC_DNS,
|
TEXT_ASYNC_DNS,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -92,7 +92,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_AUTO_FILE_RENAMING,
|
(PREF_AUTO_FILE_RENAMING,
|
||||||
TEXT_AUTO_FILE_RENAMING,
|
TEXT_AUTO_FILE_RENAMING,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
op->addTag(TAG_FILE);
|
op->addTag(TAG_FILE);
|
||||||
|
@ -112,7 +112,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_CHECK_INTEGRITY,
|
(PREF_CHECK_INTEGRITY,
|
||||||
TEXT_CHECK_INTEGRITY,
|
TEXT_CHECK_INTEGRITY,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG,
|
OptionHandler::OPT_ARG,
|
||||||
'V'));
|
'V'));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
|
@ -126,7 +126,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_CONDITIONAL_GET,
|
(PREF_CONDITIONAL_GET,
|
||||||
TEXT_CONDITIONAL_GET,
|
TEXT_CONDITIONAL_GET,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
|
@ -144,7 +144,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_CONTINUE,
|
(PREF_CONTINUE,
|
||||||
TEXT_CONTINUE,
|
TEXT_CONTINUE,
|
||||||
V_FALSE, // TODO ommit?
|
A2_V_FALSE, // TODO ommit?
|
||||||
OptionHandler::NO_ARG,
|
OptionHandler::NO_ARG,
|
||||||
'c'));
|
'c'));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
|
@ -156,7 +156,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_DAEMON,
|
(PREF_DAEMON,
|
||||||
TEXT_DAEMON,
|
TEXT_DAEMON,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::NO_ARG,
|
OptionHandler::NO_ARG,
|
||||||
'D')); // TODO ommit?
|
'D')); // TODO ommit?
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
|
@ -178,7 +178,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_DISABLE_IPV6,
|
(PREF_DISABLE_IPV6,
|
||||||
TEXT_DISABLE_IPV6,
|
TEXT_DISABLE_IPV6,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -197,7 +197,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_ASYNC_DNS6,
|
(PREF_ENABLE_ASYNC_DNS6,
|
||||||
TEXT_ENABLE_ASYNC_DNS6,
|
TEXT_ENABLE_ASYNC_DNS6,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -208,7 +208,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_DIRECT_IO,
|
(PREF_ENABLE_DIRECT_IO,
|
||||||
TEXT_ENABLE_DIRECT_IO,
|
TEXT_ENABLE_DIRECT_IO,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
op->addTag(TAG_FILE);
|
op->addTag(TAG_FILE);
|
||||||
|
@ -220,7 +220,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_XML_RPC,
|
(PREF_ENABLE_XML_RPC,
|
||||||
TEXT_ENABLE_XML_RPC,
|
TEXT_ENABLE_XML_RPC,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_XML_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -277,7 +277,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_FORCE_SEQUENTIAL,
|
(PREF_FORCE_SEQUENTIAL,
|
||||||
TEXT_FORCE_SEQUENTIAL,
|
TEXT_FORCE_SEQUENTIAL,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG,
|
OptionHandler::OPT_ARG,
|
||||||
'Z'));
|
'Z'));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
|
@ -287,7 +287,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_HUMAN_READABLE,
|
(PREF_HUMAN_READABLE,
|
||||||
TEXT_HUMAN_READABLE,
|
TEXT_HUMAN_READABLE,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -413,7 +413,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_NO_CONF,
|
(PREF_NO_CONF,
|
||||||
TEXT_NO_CONF,
|
TEXT_NO_CONF,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::NO_ARG));
|
OptionHandler::NO_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -482,7 +482,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_PARAMETERIZED_URI,
|
(PREF_PARAMETERIZED_URI,
|
||||||
TEXT_PARAMETERIZED_URI,
|
TEXT_PARAMETERIZED_URI,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG,
|
OptionHandler::OPT_ARG,
|
||||||
'P'));
|
'P'));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
|
@ -492,7 +492,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_QUIET,
|
(PREF_QUIET,
|
||||||
TEXT_QUIET,
|
TEXT_QUIET,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG,
|
OptionHandler::OPT_ARG,
|
||||||
'q'));
|
'q'));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
|
@ -503,7 +503,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_REALTIME_CHUNK_CHECKSUM,
|
(PREF_REALTIME_CHUNK_CHECKSUM,
|
||||||
TEXT_REALTIME_CHUNK_CHECKSUM,
|
TEXT_REALTIME_CHUNK_CHECKSUM,
|
||||||
V_TRUE));
|
A2_V_TRUE));
|
||||||
op->addTag(TAG_METALINK);
|
op->addTag(TAG_METALINK);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_REMOVE_CONTROL_FILE,
|
(PREF_REMOVE_CONTROL_FILE,
|
||||||
TEXT_REMOVE_CONTROL_FILE,
|
TEXT_REMOVE_CONTROL_FILE,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_ADVANCED);
|
op->addTag(TAG_ADVANCED);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -530,7 +530,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_SELECT_LEAST_USED_HOST,
|
(PREF_SELECT_LEAST_USED_HOST,
|
||||||
NO_DEFAULT_VALUE,
|
NO_DEFAULT_VALUE,
|
||||||
V_TRUE));
|
A2_V_TRUE));
|
||||||
op->hide();
|
op->hide();
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
|
@ -557,7 +557,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_XML_RPC_LISTEN_ALL,
|
(PREF_XML_RPC_LISTEN_ALL,
|
||||||
TEXT_XML_RPC_LISTEN_ALL,
|
TEXT_XML_RPC_LISTEN_ALL,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_XML_RPC);
|
op->addTag(TAG_XML_RPC);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -610,7 +610,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_DRY_RUN,
|
(PREF_DRY_RUN,
|
||||||
TEXT_DRY_RUN,
|
TEXT_DRY_RUN,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
|
@ -651,7 +651,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_NO_NETRC,
|
(PREF_NO_NETRC,
|
||||||
TEXT_NO_NETRC,
|
TEXT_NO_NETRC,
|
||||||
V_FALSE, // TODO ommit?
|
A2_V_FALSE, // TODO ommit?
|
||||||
OptionHandler::NO_ARG,
|
OptionHandler::NO_ARG,
|
||||||
'n'));
|
'n'));
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
|
@ -676,7 +676,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_REMOTE_TIME,
|
(PREF_REMOTE_TIME,
|
||||||
TEXT_REMOTE_TIME,
|
TEXT_REMOTE_TIME,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG,
|
OptionHandler::OPT_ARG,
|
||||||
'R'));
|
'R'));
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
|
@ -687,7 +687,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_REUSE_URI,
|
(PREF_REUSE_URI,
|
||||||
TEXT_REUSE_URI,
|
TEXT_REUSE_URI,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
|
@ -798,7 +798,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_CHECK_CERTIFICATE,
|
(PREF_CHECK_CERTIFICATE,
|
||||||
TEXT_CHECK_CERTIFICATE,
|
TEXT_CHECK_CERTIFICATE,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
op->addTag(TAG_HTTPS);
|
op->addTag(TAG_HTTPS);
|
||||||
|
@ -808,7 +808,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_HTTP_KEEP_ALIVE,
|
(PREF_ENABLE_HTTP_KEEP_ALIVE,
|
||||||
TEXT_ENABLE_HTTP_KEEP_ALIVE,
|
TEXT_ENABLE_HTTP_KEEP_ALIVE,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -817,7 +817,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_HTTP_PIPELINING,
|
(PREF_ENABLE_HTTP_PIPELINING,
|
||||||
TEXT_ENABLE_HTTP_PIPELINING,
|
TEXT_ENABLE_HTTP_PIPELINING,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -835,7 +835,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_HTTP_ACCEPT_GZIP,
|
(PREF_HTTP_ACCEPT_GZIP,
|
||||||
TEXT_HTTP_ACCEPT_GZIP,
|
TEXT_HTTP_ACCEPT_GZIP,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -844,7 +844,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_HTTP_AUTH_CHALLENGE,
|
(PREF_HTTP_AUTH_CHALLENGE,
|
||||||
TEXT_HTTP_AUTH_CHALLENGE,
|
TEXT_HTTP_AUTH_CHALLENGE,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -853,7 +853,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_HTTP_NO_CACHE,
|
(PREF_HTTP_NO_CACHE,
|
||||||
TEXT_HTTP_NO_CACHE,
|
TEXT_HTTP_NO_CACHE,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -923,7 +923,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_USE_HEAD,
|
(PREF_USE_HEAD,
|
||||||
TEXT_USE_HEAD,
|
TEXT_USE_HEAD,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -952,7 +952,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_FTP_PASV,
|
(PREF_FTP_PASV,
|
||||||
TEXT_FTP_PASV,
|
TEXT_FTP_PASV,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG,
|
OptionHandler::OPT_ARG,
|
||||||
'p'));
|
'p'));
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
|
@ -962,7 +962,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_FTP_REUSE_CONNECTION,
|
(PREF_FTP_REUSE_CONNECTION,
|
||||||
TEXT_FTP_REUSE_CONNECTION,
|
TEXT_FTP_REUSE_CONNECTION,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -1136,7 +1136,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_SHOW_FILES,
|
(PREF_SHOW_FILES,
|
||||||
TEXT_SHOW_FILES,
|
TEXT_SHOW_FILES,
|
||||||
V_FALSE, // TODO ommit?
|
A2_V_FALSE, // TODO ommit?
|
||||||
OptionHandler::NO_ARG,
|
OptionHandler::NO_ARG,
|
||||||
'S'));
|
'S'));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
|
@ -1151,7 +1151,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_BT_ENABLE_LPD,
|
(PREF_BT_ENABLE_LPD,
|
||||||
TEXT_BT_ENABLE_LPD,
|
TEXT_BT_ENABLE_LPD,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -1188,7 +1188,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_BT_HASH_CHECK_SEED,
|
(PREF_BT_HASH_CHECK_SEED,
|
||||||
TEXT_BT_HASH_CHECK_SEED,
|
TEXT_BT_HASH_CHECK_SEED,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -1226,7 +1226,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_BT_METADATA_ONLY,
|
(PREF_BT_METADATA_ONLY,
|
||||||
TEXT_BT_METADATA_ONLY,
|
TEXT_BT_METADATA_ONLY,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -1260,7 +1260,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_BT_REQUIRE_CRYPTO,
|
(PREF_BT_REQUIRE_CRYPTO,
|
||||||
TEXT_BT_REQUIRE_CRYPTO,
|
TEXT_BT_REQUIRE_CRYPTO,
|
||||||
V_FALSE));
|
A2_V_FALSE));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
|
@ -1277,7 +1277,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_BT_SEED_UNVERIFIED,
|
(PREF_BT_SEED_UNVERIFIED,
|
||||||
TEXT_BT_SEED_UNVERIFIED,
|
TEXT_BT_SEED_UNVERIFIED,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -1286,7 +1286,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_BT_SAVE_METADATA,
|
(PREF_BT_SAVE_METADATA,
|
||||||
TEXT_BT_SAVE_METADATA,
|
TEXT_BT_SAVE_METADATA,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -1425,7 +1425,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_DHT,
|
(PREF_ENABLE_DHT,
|
||||||
TEXT_ENABLE_DHT,
|
TEXT_ENABLE_DHT,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
|
@ -1435,7 +1435,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_DHT6,
|
(PREF_ENABLE_DHT6,
|
||||||
TEXT_ENABLE_DHT6,
|
TEXT_ENABLE_DHT6,
|
||||||
V_FALSE,
|
A2_V_FALSE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
|
@ -1445,7 +1445,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_ENABLE_PEER_EXCHANGE,
|
(PREF_ENABLE_PEER_EXCHANGE,
|
||||||
TEXT_ENABLE_PEER_EXCHANGE,
|
TEXT_ENABLE_PEER_EXCHANGE,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
@ -1454,8 +1454,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new ParameterOptionHandler
|
SharedHandle<OptionHandler> op(new ParameterOptionHandler
|
||||||
(PREF_FOLLOW_TORRENT,
|
(PREF_FOLLOW_TORRENT,
|
||||||
TEXT_FOLLOW_TORRENT,
|
TEXT_FOLLOW_TORRENT,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
V_TRUE, V_MEM, V_FALSE));
|
A2_V_TRUE, V_MEM, A2_V_FALSE));
|
||||||
op->addTag(TAG_BITTORRENT);
|
op->addTag(TAG_BITTORRENT);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
|
@ -1561,8 +1561,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new ParameterOptionHandler
|
SharedHandle<OptionHandler> op(new ParameterOptionHandler
|
||||||
(PREF_FOLLOW_METALINK,
|
(PREF_FOLLOW_METALINK,
|
||||||
TEXT_FOLLOW_METALINK,
|
TEXT_FOLLOW_METALINK,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
V_TRUE, V_MEM, V_FALSE));
|
A2_V_TRUE, V_MEM, A2_V_FALSE));
|
||||||
op->addTag(TAG_METALINK);
|
op->addTag(TAG_METALINK);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
|
@ -1570,7 +1570,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
SharedHandle<OptionHandler> op(new BooleanOptionHandler
|
||||||
(PREF_METALINK_ENABLE_UNIQUE_PROTOCOL,
|
(PREF_METALINK_ENABLE_UNIQUE_PROTOCOL,
|
||||||
TEXT_METALINK_ENABLE_UNIQUE_PROTOCOL,
|
TEXT_METALINK_ENABLE_UNIQUE_PROTOCOL,
|
||||||
V_TRUE,
|
A2_V_TRUE,
|
||||||
OptionHandler::OPT_ARG));
|
OptionHandler::OPT_ARG));
|
||||||
op->addTag(TAG_METALINK);
|
op->addTag(TAG_METALINK);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
|
|
@ -129,9 +129,9 @@ public:
|
||||||
((argType_ == OptionHandler::OPT_ARG ||
|
((argType_ == OptionHandler::OPT_ARG ||
|
||||||
argType_ == OptionHandler::NO_ARG)
|
argType_ == OptionHandler::NO_ARG)
|
||||||
&& optarg.empty())) {
|
&& optarg.empty())) {
|
||||||
option.put(optName_, V_TRUE);
|
option.put(optName_, A2_V_TRUE);
|
||||||
} else if(optarg == "false") {
|
} else if(optarg == "false") {
|
||||||
option.put(optName_, V_FALSE);
|
option.put(optName_, A2_V_FALSE);
|
||||||
} else {
|
} else {
|
||||||
std::string msg = optName_;
|
std::string msg = optName_;
|
||||||
strappend(msg, " ", _("must be either 'true' or 'false'."));
|
strappend(msg, " ", _("must be either 'true' or 'false'."));
|
||||||
|
|
|
@ -236,13 +236,13 @@ TrackerWatcherCommand::createRequestGroup(const std::string& uri)
|
||||||
rg->getOption()->put(PREF_MAX_TRIES, "2");
|
rg->getOption()->put(PREF_MAX_TRIES, "2");
|
||||||
// TODO When dry-run mode becomes available in BitTorrent, set
|
// TODO When dry-run mode becomes available in BitTorrent, set
|
||||||
// PREF_DRY_RUN=false too.
|
// PREF_DRY_RUN=false too.
|
||||||
rg->getOption()->put(PREF_USE_HEAD, V_FALSE);
|
rg->getOption()->put(PREF_USE_HEAD, A2_V_FALSE);
|
||||||
// Setting tracker timeouts
|
// Setting tracker timeouts
|
||||||
rg->setTimeout(rg->getOption()->getAsInt(PREF_BT_TRACKER_TIMEOUT));
|
rg->setTimeout(rg->getOption()->getAsInt(PREF_BT_TRACKER_TIMEOUT));
|
||||||
rg->getOption()->put(PREF_CONNECT_TIMEOUT,
|
rg->getOption()->put(PREF_CONNECT_TIMEOUT,
|
||||||
rg->getOption()->get(PREF_BT_TRACKER_CONNECT_TIMEOUT));
|
rg->getOption()->get(PREF_BT_TRACKER_CONNECT_TIMEOUT));
|
||||||
rg->getOption()->put(PREF_REUSE_URI, V_FALSE);
|
rg->getOption()->put(PREF_REUSE_URI, A2_V_FALSE);
|
||||||
rg->getOption()->put(PREF_SELECT_LEAST_USED_HOST, V_FALSE);
|
rg->getOption()->put(PREF_SELECT_LEAST_USED_HOST, A2_V_FALSE);
|
||||||
static const std::string TRACKER_ANNOUNCE_FILE("[tracker.announce]");
|
static const std::string TRACKER_ANNOUNCE_FILE("[tracker.announce]");
|
||||||
SharedHandle<DownloadContext> dctx
|
SharedHandle<DownloadContext> dctx
|
||||||
(new DownloadContext(getOption()->getAsInt(PREF_SEGMENT_SIZE),
|
(new DownloadContext(getOption()->getAsInt(PREF_SEGMENT_SIZE),
|
||||||
|
|
|
@ -315,7 +315,7 @@ void createRequestGroupForBitTorrent
|
||||||
bool adjustAnnounceUri)
|
bool adjustAnnounceUri)
|
||||||
{
|
{
|
||||||
std::vector<std::string> nargs;
|
std::vector<std::string> nargs;
|
||||||
if(option->get(PREF_PARAMETERIZED_URI) == V_TRUE) {
|
if(option->get(PREF_PARAMETERIZED_URI) == A2_V_TRUE) {
|
||||||
unfoldURI(nargs, uris);
|
unfoldURI(nargs, uris);
|
||||||
} else {
|
} else {
|
||||||
nargs = uris;
|
nargs = uris;
|
||||||
|
@ -437,12 +437,12 @@ void createRequestGroupForUri
|
||||||
bool ignoreLocalPath)
|
bool ignoreLocalPath)
|
||||||
{
|
{
|
||||||
std::vector<std::string> nargs;
|
std::vector<std::string> nargs;
|
||||||
if(option->get(PREF_PARAMETERIZED_URI) == V_TRUE) {
|
if(option->get(PREF_PARAMETERIZED_URI) == A2_V_TRUE) {
|
||||||
unfoldURI(nargs, uris);
|
unfoldURI(nargs, uris);
|
||||||
} else {
|
} else {
|
||||||
nargs = uris;
|
nargs = uris;
|
||||||
}
|
}
|
||||||
if(!ignoreForceSequential && option->get(PREF_FORCE_SEQUENTIAL) == V_TRUE) {
|
if(!ignoreForceSequential && option->get(PREF_FORCE_SEQUENTIAL) == A2_V_TRUE) {
|
||||||
std::for_each(nargs.begin(), nargs.end(),
|
std::for_each(nargs.begin(), nargs.end(),
|
||||||
AccRequestGroup(result, option, ignoreLocalPath));
|
AccRequestGroup(result, option, ignoreLocalPath));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -215,7 +215,7 @@ downloadresultcode::RESULT main(int argc, char* argv[])
|
||||||
std::vector<SharedHandle<RequestGroup> > requestGroups;
|
std::vector<SharedHandle<RequestGroup> > requestGroups;
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
if(!op->blank(PREF_TORRENT_FILE)) {
|
if(!op->blank(PREF_TORRENT_FILE)) {
|
||||||
if(op->get(PREF_SHOW_FILES) == V_TRUE) {
|
if(op->get(PREF_SHOW_FILES) == A2_V_TRUE) {
|
||||||
showTorrentFile(op->get(PREF_TORRENT_FILE));
|
showTorrentFile(op->get(PREF_TORRENT_FILE));
|
||||||
return exitStatus;
|
return exitStatus;
|
||||||
} else {
|
} else {
|
||||||
|
@ -226,7 +226,7 @@ downloadresultcode::RESULT main(int argc, char* argv[])
|
||||||
#endif // ENABLE_BITTORRENT
|
#endif // ENABLE_BITTORRENT
|
||||||
#ifdef ENABLE_METALINK
|
#ifdef ENABLE_METALINK
|
||||||
if(!op->blank(PREF_METALINK_FILE)) {
|
if(!op->blank(PREF_METALINK_FILE)) {
|
||||||
if(op->get(PREF_SHOW_FILES) == V_TRUE) {
|
if(op->get(PREF_SHOW_FILES) == A2_V_TRUE) {
|
||||||
showMetalinkFile(op->get(PREF_METALINK_FILE), op);
|
showMetalinkFile(op->get(PREF_METALINK_FILE), op);
|
||||||
return exitStatus;
|
return exitStatus;
|
||||||
} else {
|
} else {
|
||||||
|
@ -238,7 +238,7 @@ downloadresultcode::RESULT main(int argc, char* argv[])
|
||||||
if(!op->blank(PREF_INPUT_FILE)) {
|
if(!op->blank(PREF_INPUT_FILE)) {
|
||||||
createRequestGroupForUriList(requestGroups, op);
|
createRequestGroupForUriList(requestGroups, op);
|
||||||
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
|
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
|
||||||
} else if(op->get(PREF_SHOW_FILES) == V_TRUE) {
|
} else if(op->get(PREF_SHOW_FILES) == A2_V_TRUE) {
|
||||||
showFiles(args, op);
|
showFiles(args, op);
|
||||||
return exitStatus;
|
return exitStatus;
|
||||||
#endif // ENABLE_METALINK || ENABLE_METALINK
|
#endif // ENABLE_METALINK || ENABLE_METALINK
|
||||||
|
|
|
@ -39,8 +39,8 @@ namespace aria2 {
|
||||||
/**
|
/**
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
const std::string V_TRUE("true");
|
const std::string A2_V_TRUE("true");
|
||||||
const std::string V_FALSE("false");
|
const std::string A2_V_FALSE("false");
|
||||||
const std::string V_NONE("none");
|
const std::string V_NONE("none");
|
||||||
const std::string V_MEM("mem");
|
const std::string V_MEM("mem");
|
||||||
const std::string V_ALL("all");
|
const std::string V_ALL("all");
|
||||||
|
|
|
@ -43,8 +43,8 @@ namespace aria2 {
|
||||||
/**
|
/**
|
||||||
* Constants
|
* Constants
|
||||||
*/
|
*/
|
||||||
extern const std::string V_TRUE;
|
extern const std::string A2_V_TRUE;
|
||||||
extern const std::string V_FALSE;
|
extern const std::string A2_V_FALSE;
|
||||||
extern const std::string V_NONE;
|
extern const std::string V_NONE;
|
||||||
extern const std::string V_MEM;
|
extern const std::string V_MEM;
|
||||||
extern const std::string V_ALL;
|
extern const std::string V_ALL;
|
||||||
|
|
|
@ -35,8 +35,8 @@ void AuthConfigFactoryTest::testCreateAuthConfig_http()
|
||||||
req->setUri("http://localhost/download/aria2-1.0.0.tar.bz2");
|
req->setUri("http://localhost/download/aria2-1.0.0.tar.bz2");
|
||||||
|
|
||||||
Option option;
|
Option option;
|
||||||
option.put(PREF_NO_NETRC, V_FALSE);
|
option.put(PREF_NO_NETRC, A2_V_FALSE);
|
||||||
option.put(PREF_HTTP_AUTH_CHALLENGE, V_TRUE);
|
option.put(PREF_HTTP_AUTH_CHALLENGE, A2_V_TRUE);
|
||||||
|
|
||||||
AuthConfigFactory factory;
|
AuthConfigFactory factory;
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void AuthConfigFactoryTest::testCreateAuthConfig_httpNoChallenge()
|
||||||
req->setUri("http://localhost/download/aria2-1.0.0.tar.bz2");
|
req->setUri("http://localhost/download/aria2-1.0.0.tar.bz2");
|
||||||
|
|
||||||
Option option;
|
Option option;
|
||||||
option.put(PREF_NO_NETRC, V_FALSE);
|
option.put(PREF_NO_NETRC, A2_V_FALSE);
|
||||||
|
|
||||||
AuthConfigFactory factory;
|
AuthConfigFactory factory;
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ void AuthConfigFactoryTest::testCreateAuthConfig_ftp()
|
||||||
req->setUri("ftp://localhost/download/aria2-1.0.0.tar.bz2");
|
req->setUri("ftp://localhost/download/aria2-1.0.0.tar.bz2");
|
||||||
|
|
||||||
Option option;
|
Option option;
|
||||||
option.put(PREF_NO_NETRC, V_FALSE);
|
option.put(PREF_NO_NETRC, A2_V_FALSE);
|
||||||
|
|
||||||
AuthConfigFactory factory;
|
AuthConfigFactory factory;
|
||||||
|
|
||||||
|
@ -155,12 +155,12 @@ void AuthConfigFactoryTest::testCreateAuthConfig_ftp()
|
||||||
factory.createAuthConfig(req, &option)->getAuthText());
|
factory.createAuthConfig(req, &option)->getAuthText());
|
||||||
|
|
||||||
// disable Netrc
|
// disable Netrc
|
||||||
option.put(PREF_NO_NETRC, V_TRUE);
|
option.put(PREF_NO_NETRC, A2_V_TRUE);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("anonymous:ARIA2USER@"),
|
CPPUNIT_ASSERT_EQUAL(std::string("anonymous:ARIA2USER@"),
|
||||||
factory.createAuthConfig(req, &option)->getAuthText());
|
factory.createAuthConfig(req, &option)->getAuthText());
|
||||||
|
|
||||||
// with Netrc + user defined
|
// with Netrc + user defined
|
||||||
option.put(PREF_NO_NETRC, V_FALSE);
|
option.put(PREF_NO_NETRC, A2_V_FALSE);
|
||||||
option.put(PREF_FTP_USER, "userDefinedUser");
|
option.put(PREF_FTP_USER, "userDefinedUser");
|
||||||
option.put(PREF_FTP_PASSWD, "userDefinedPassword");
|
option.put(PREF_FTP_PASSWD, "userDefinedPassword");
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("userDefinedUser:userDefinedPassword"),
|
CPPUNIT_ASSERT_EQUAL(std::string("userDefinedUser:userDefinedPassword"),
|
||||||
|
@ -198,8 +198,8 @@ void AuthConfigFactoryTest::testCreateAuthConfig_ftp()
|
||||||
void AuthConfigFactoryTest::testUpdateBasicCred()
|
void AuthConfigFactoryTest::testUpdateBasicCred()
|
||||||
{
|
{
|
||||||
Option option;
|
Option option;
|
||||||
option.put(PREF_NO_NETRC, V_FALSE);
|
option.put(PREF_NO_NETRC, A2_V_FALSE);
|
||||||
option.put(PREF_HTTP_AUTH_CHALLENGE, V_TRUE);
|
option.put(PREF_HTTP_AUTH_CHALLENGE, A2_V_TRUE);
|
||||||
|
|
||||||
AuthConfigFactory factory;
|
AuthConfigFactory factory;
|
||||||
|
|
||||||
|
|
|
@ -419,7 +419,7 @@ void DefaultBtProgressInfoFileTest::testLoad_nonBt()
|
||||||
void DefaultBtProgressInfoFileTest::testLoad_nonBt_pieceLengthShorter()
|
void DefaultBtProgressInfoFileTest::testLoad_nonBt_pieceLengthShorter()
|
||||||
{
|
{
|
||||||
initializeMembers(512, 81920);
|
initializeMembers(512, 81920);
|
||||||
option_->put(PREF_ALLOW_PIECE_LENGTH_CHANGE, V_TRUE);
|
option_->put(PREF_ALLOW_PIECE_LENGTH_CHANGE, A2_V_TRUE);
|
||||||
|
|
||||||
SharedHandle<DownloadContext> dctx
|
SharedHandle<DownloadContext> dctx
|
||||||
(new DownloadContext(512, 81920, "load-nonBt-v0001"));
|
(new DownloadContext(512, 81920, "load-nonBt-v0001"));
|
||||||
|
|
|
@ -119,7 +119,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri()
|
||||||
CPPUNIT_ASSERT_EQUAL(array[i%3], xuris[i]);
|
CPPUNIT_ASSERT_EQUAL(array[i%3], xuris[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
option_->put(PREF_FORCE_SEQUENTIAL, V_TRUE);
|
option_->put(PREF_FORCE_SEQUENTIAL, A2_V_TRUE);
|
||||||
{
|
{
|
||||||
std::vector<SharedHandle<RequestGroup> > result;
|
std::vector<SharedHandle<RequestGroup> > result;
|
||||||
createRequestGroupForUri(result, option_, uris);
|
createRequestGroupForUri(result, option_, uris);
|
||||||
|
@ -152,7 +152,7 @@ void DownloadHelperTest::testCreateRequestGroupForUri_parameterized()
|
||||||
option_->put(PREF_SPLIT, "3");
|
option_->put(PREF_SPLIT, "3");
|
||||||
option_->put(PREF_DIR, "/tmp");
|
option_->put(PREF_DIR, "/tmp");
|
||||||
option_->put(PREF_OUT, "file.out");
|
option_->put(PREF_OUT, "file.out");
|
||||||
option_->put(PREF_PARAMETERIZED_URI, V_TRUE);
|
option_->put(PREF_PARAMETERIZED_URI, A2_V_TRUE);
|
||||||
{
|
{
|
||||||
std::vector<SharedHandle<RequestGroup> > result;
|
std::vector<SharedHandle<RequestGroup> > result;
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ void DownloadHelperTest::testCreateRequestGroupForBitTorrent()
|
||||||
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
group->getDownloadContext()->getFirstFileEntry()->getUris(uris);
|
||||||
CPPUNIT_ASSERT_EQUAL((size_t)0, uris.size());
|
CPPUNIT_ASSERT_EQUAL((size_t)0, uris.size());
|
||||||
}
|
}
|
||||||
option_->put(PREF_FORCE_SEQUENTIAL, V_TRUE);
|
option_->put(PREF_FORCE_SEQUENTIAL, A2_V_TRUE);
|
||||||
{
|
{
|
||||||
std::vector<SharedHandle<RequestGroup> > result;
|
std::vector<SharedHandle<RequestGroup> > result;
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
void setUp()
|
void setUp()
|
||||||
{
|
{
|
||||||
option_.reset(new Option());
|
option_.reset(new Option());
|
||||||
option_->put(PREF_HTTP_AUTH_CHALLENGE, V_TRUE);
|
option_->put(PREF_HTTP_AUTH_CHALLENGE, A2_V_TRUE);
|
||||||
authConfigFactory_.reset(new AuthConfigFactory());
|
authConfigFactory_.reset(new AuthConfigFactory());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,10 +69,10 @@ void OptionHandlerTest::testBooleanOptionHandler()
|
||||||
CPPUNIT_ASSERT(handler.canHandle("foo"));
|
CPPUNIT_ASSERT(handler.canHandle("foo"));
|
||||||
CPPUNIT_ASSERT(!handler.canHandle("foobar"));
|
CPPUNIT_ASSERT(!handler.canHandle("foobar"));
|
||||||
Option option;
|
Option option;
|
||||||
handler.parse(option, V_TRUE);
|
handler.parse(option, A2_V_TRUE);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string(V_TRUE), option.get("foo"));
|
CPPUNIT_ASSERT_EQUAL(std::string(A2_V_TRUE), option.get("foo"));
|
||||||
handler.parse(option, V_FALSE);
|
handler.parse(option, A2_V_FALSE);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string(V_FALSE), option.get("foo"));
|
CPPUNIT_ASSERT_EQUAL(std::string(A2_V_FALSE), option.get("foo"));
|
||||||
try {
|
try {
|
||||||
handler.parse(option, "hello");
|
handler.parse(option, "hello");
|
||||||
CPPUNIT_FAIL("exception must be thrown.");
|
CPPUNIT_FAIL("exception must be thrown.");
|
||||||
|
|
|
@ -116,7 +116,7 @@ void UTMetadataPostDownloadHandlerTest::testGetNextRequestGroups()
|
||||||
|
|
||||||
results.clear();
|
results.clear();
|
||||||
|
|
||||||
requestGroup_->getOption()->put(PREF_BT_SAVE_METADATA, V_TRUE);
|
requestGroup_->getOption()->put(PREF_BT_SAVE_METADATA, A2_V_TRUE);
|
||||||
handler.getNextRequestGroups(results, requestGroup_.get());
|
handler.getNextRequestGroups(results, requestGroup_.get());
|
||||||
CPPUNIT_ASSERT(trfile.exists());
|
CPPUNIT_ASSERT(trfile.exists());
|
||||||
|
|
||||||
|
|
|
@ -995,7 +995,7 @@ void XmlRpcMethodTest::testPause()
|
||||||
"http://url3",
|
"http://url3",
|
||||||
};
|
};
|
||||||
std::vector<std::string> uris(vbegin(URIS), vend(URIS));
|
std::vector<std::string> uris(vbegin(URIS), vend(URIS));
|
||||||
option_->put(PREF_FORCE_SEQUENTIAL, V_TRUE);
|
option_->put(PREF_FORCE_SEQUENTIAL, A2_V_TRUE);
|
||||||
std::vector<SharedHandle<RequestGroup> > groups;
|
std::vector<SharedHandle<RequestGroup> > groups;
|
||||||
createRequestGroupForUri(groups, option_, uris);
|
createRequestGroupForUri(groups, option_, uris);
|
||||||
CPPUNIT_ASSERT_EQUAL((size_t)3, groups.size());
|
CPPUNIT_ASSERT_EQUAL((size_t)3, groups.size());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue