mirror of https://github.com/aria2/aria2
2008-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Renamed --http-proxy-method as --proxy-method. * src/AbstractCommand.cc * src/FtpInitiateConnectionCommand.cc * src/HttpInitiateConnectionCommand.cc * src/OptionHandlerFactory.cc * src/option_processing.cc * src/prefs.cc * src/prefs.h * src/usage_text.hpull/1/head
parent
c7fb678e6e
commit
bd2ead4763
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2008-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Renamed --http-proxy-method as --proxy-method.
|
||||||
|
* src/AbstractCommand.cc
|
||||||
|
* src/FtpInitiateConnectionCommand.cc
|
||||||
|
* src/HttpInitiateConnectionCommand.cc
|
||||||
|
* src/OptionHandlerFactory.cc
|
||||||
|
* src/option_processing.cc
|
||||||
|
* src/prefs.cc
|
||||||
|
* src/prefs.h
|
||||||
|
* src/usage_text.h
|
||||||
|
|
||||||
2008-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Deprecated --http-proxy-user and --http-proxy-passwd options.
|
Deprecated --http-proxy-user and --http-proxy-passwd options.
|
||||||
|
|
|
@ -323,7 +323,7 @@ static bool isProxyRequest(const std::string& protocol, const Option* option)
|
||||||
|
|
||||||
static bool isProxyGETRequest(const std::string& protocol, const Option* option)
|
static bool isProxyGETRequest(const std::string& protocol, const Option* option)
|
||||||
{
|
{
|
||||||
if(option->get(PREF_HTTP_PROXY_METHOD) != V_GET) {
|
if(option->get(PREF_PROXY_METHOD) != V_GET) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isProxyRequest(protocol, option);
|
return isProxyRequest(protocol, option);
|
||||||
|
|
|
@ -74,7 +74,7 @@ Command* FtpInitiateConnectionCommand::createNextCommand
|
||||||
socket->establishConnection(resolvedAddresses.front(),
|
socket->establishConnection(resolvedAddresses.front(),
|
||||||
proxyRequest->getPort());
|
proxyRequest->getPort());
|
||||||
|
|
||||||
if(e->option->get(PREF_HTTP_PROXY_METHOD) == V_GET) {
|
if(e->option->get(PREF_PROXY_METHOD) == V_GET) {
|
||||||
SharedHandle<HttpConnection> hc
|
SharedHandle<HttpConnection> hc
|
||||||
(new HttpConnection(cuid, socket, e->option));
|
(new HttpConnection(cuid, socket, e->option));
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ Command* FtpInitiateConnectionCommand::createNextCommand
|
||||||
new HttpRequestCommand(cuid, req, _requestGroup, hc, e, socket);
|
new HttpRequestCommand(cuid, req, _requestGroup, hc, e, socket);
|
||||||
c->setProxyRequest(proxyRequest);
|
c->setProxyRequest(proxyRequest);
|
||||||
command = c;
|
command = c;
|
||||||
} else if(e->option->get(PREF_HTTP_PROXY_METHOD) == V_TUNNEL) {
|
} else if(e->option->get(PREF_PROXY_METHOD) == V_TUNNEL) {
|
||||||
command = new FtpTunnelRequestCommand(cuid, req, _requestGroup, e,
|
command = new FtpTunnelRequestCommand(cuid, req, _requestGroup, e,
|
||||||
proxyRequest, socket);
|
proxyRequest, socket);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -103,12 +103,12 @@ Command* HttpInitiateConnectionCommand::createNextCommand
|
||||||
|
|
||||||
bool HttpInitiateConnectionCommand::useProxyGet() const
|
bool HttpInitiateConnectionCommand::useProxyGet() const
|
||||||
{
|
{
|
||||||
return e->option->get(PREF_HTTP_PROXY_METHOD) == V_GET;
|
return e->option->get(PREF_PROXY_METHOD) == V_GET;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HttpInitiateConnectionCommand::useProxyTunnel() const
|
bool HttpInitiateConnectionCommand::useProxyTunnel() const
|
||||||
{
|
{
|
||||||
return e->option->get(PREF_HTTP_PROXY_METHOD) == V_TUNNEL;
|
return e->option->get(PREF_PROXY_METHOD) == V_TUNNEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -471,15 +471,6 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
{
|
|
||||||
SharedHandle<OptionHandler> op(new ParameterOptionHandler
|
|
||||||
(PREF_HTTP_PROXY_METHOD,
|
|
||||||
TEXT_HTTP_PROXY_METHOD,
|
|
||||||
V_TUNNEL,
|
|
||||||
V_GET, V_TUNNEL));
|
|
||||||
op->addTag(TAG_HTTP);
|
|
||||||
handlers.push_back(op);
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
SharedHandle<OptionHandler> op(new DefaultOptionHandler
|
||||||
(PREF_HTTP_USER,
|
(PREF_HTTP_USER,
|
||||||
|
@ -612,8 +603,18 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
(PREF_ALL_PROXY,
|
(PREF_ALL_PROXY,
|
||||||
TEXT_ALL_PROXY,
|
TEXT_ALL_PROXY,
|
||||||
NO_DEFAULT_VALUE));
|
NO_DEFAULT_VALUE));
|
||||||
op->addTag(TAG_HTTP);
|
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
|
op->addTag(TAG_HTTP);
|
||||||
|
handlers.push_back(op);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
SharedHandle<OptionHandler> op(new ParameterOptionHandler
|
||||||
|
(PREF_PROXY_METHOD,
|
||||||
|
TEXT_PROXY_METHOD,
|
||||||
|
V_TUNNEL,
|
||||||
|
V_GET, V_TUNNEL));
|
||||||
|
op->addTag(TAG_FTP);
|
||||||
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
// BitTorrent/Metalink Options
|
// BitTorrent/Metalink Options
|
||||||
|
|
|
@ -117,7 +117,7 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
{ PREF_FTP_TYPE.c_str(), required_argument, &lopt, 11 },
|
{ PREF_FTP_TYPE.c_str(), required_argument, &lopt, 11 },
|
||||||
{ PREF_FTP_PASV.c_str(), no_argument, NULL, 'p' },
|
{ PREF_FTP_PASV.c_str(), no_argument, NULL, 'p' },
|
||||||
{ "ftp-via-http-proxy", required_argument, &lopt, 12 },
|
{ "ftp-via-http-proxy", required_argument, &lopt, 12 },
|
||||||
{ PREF_HTTP_PROXY_METHOD.c_str(), required_argument, &lopt, 14 },
|
{ "http-proxy-method", required_argument, &lopt, 14 },
|
||||||
{ PREF_LOWEST_SPEED_LIMIT.c_str(), required_argument, &lopt, 200 },
|
{ PREF_LOWEST_SPEED_LIMIT.c_str(), required_argument, &lopt, 200 },
|
||||||
{ PREF_MAX_DOWNLOAD_LIMIT.c_str(), required_argument, &lopt, 201 },
|
{ PREF_MAX_DOWNLOAD_LIMIT.c_str(), required_argument, &lopt, 201 },
|
||||||
{ PREF_FILE_ALLOCATION.c_str(), required_argument, 0, 'a' },
|
{ PREF_FILE_ALLOCATION.c_str(), required_argument, 0, 'a' },
|
||||||
|
@ -164,6 +164,7 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
{ PREF_HTTPS_PROXY.c_str(), required_argument, &lopt, 227 },
|
{ PREF_HTTPS_PROXY.c_str(), required_argument, &lopt, 227 },
|
||||||
{ PREF_FTP_PROXY.c_str(), required_argument, &lopt, 228 },
|
{ PREF_FTP_PROXY.c_str(), required_argument, &lopt, 228 },
|
||||||
{ PREF_ALL_PROXY.c_str(), required_argument, &lopt, 229 },
|
{ PREF_ALL_PROXY.c_str(), required_argument, &lopt, 229 },
|
||||||
|
{ PREF_PROXY_METHOD.c_str(), required_argument, &lopt, 230 },
|
||||||
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
|
#if defined ENABLE_BITTORRENT || defined ENABLE_METALINK
|
||||||
{ PREF_SHOW_FILES.c_str(), no_argument, NULL, 'S' },
|
{ PREF_SHOW_FILES.c_str(), no_argument, NULL, 'S' },
|
||||||
{ PREF_SELECT_FILE.c_str(), required_argument, &lopt, 21 },
|
{ PREF_SELECT_FILE.c_str(), required_argument, &lopt, 21 },
|
||||||
|
@ -257,8 +258,10 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
case 14:
|
case 14:
|
||||||
cmdstream << PREF_HTTP_PROXY_METHOD << "=" << optarg << "\n";
|
std::cout << "--http-proxy-method was deprecated."
|
||||||
break;
|
<< " Use --proxy-method option instead."
|
||||||
|
<< std::endl;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
case 15:
|
case 15:
|
||||||
cmdstream << PREF_LISTEN_PORT << "=" << optarg << "\n";
|
cmdstream << PREF_LISTEN_PORT << "=" << optarg << "\n";
|
||||||
break;
|
break;
|
||||||
|
@ -427,6 +430,9 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
case 229:
|
case 229:
|
||||||
cmdstream << PREF_ALL_PROXY << "=" << optarg << "\n";
|
cmdstream << PREF_ALL_PROXY << "=" << optarg << "\n";
|
||||||
break;
|
break;
|
||||||
|
case 230:
|
||||||
|
cmdstream << PREF_PROXY_METHOD << "=" << optarg << "\n";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ const std::string PREF_HTTPS_PROXY("https-proxy");
|
||||||
const std::string PREF_FTP_PROXY("ftp-proxy");
|
const std::string PREF_FTP_PROXY("ftp-proxy");
|
||||||
const std::string PREF_ALL_PROXY("all-proxy");
|
const std::string PREF_ALL_PROXY("all-proxy");
|
||||||
// values: get | tunnel
|
// values: get | tunnel
|
||||||
const std::string PREF_HTTP_PROXY_METHOD("http-proxy-method");
|
const std::string PREF_PROXY_METHOD("proxy-method");
|
||||||
const std::string V_GET("get");
|
const std::string V_GET("get");
|
||||||
const std::string V_TUNNEL("tunnel");
|
const std::string V_TUNNEL("tunnel");
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ extern const std::string PREF_HTTPS_PROXY;
|
||||||
extern const std::string PREF_FTP_PROXY;
|
extern const std::string PREF_FTP_PROXY;
|
||||||
extern const std::string PREF_ALL_PROXY;
|
extern const std::string PREF_ALL_PROXY;
|
||||||
// values: get | tunnel
|
// values: get | tunnel
|
||||||
extern const std::string PREF_HTTP_PROXY_METHOD;
|
extern const std::string PREF_PROXY_METHOD;
|
||||||
extern const std::string V_GET;
|
extern const std::string V_GET;
|
||||||
extern const std::string V_TUNNEL;
|
extern const std::string V_TUNNEL;
|
||||||
|
|
||||||
|
|
|
@ -79,8 +79,8 @@ _(" --all-proxy=PROXY Use this proxy server in the all protocols.\n"\
|
||||||
_(" --http-user=USER Set HTTP user. This affects all URLs.")
|
_(" --http-user=USER Set HTTP user. This affects all URLs.")
|
||||||
#define TEXT_HTTP_PASSWD \
|
#define TEXT_HTTP_PASSWD \
|
||||||
_(" --http-passwd=PASSWD Set HTTP password. This affects all URLs.")
|
_(" --http-passwd=PASSWD Set HTTP password. This affects all URLs.")
|
||||||
#define TEXT_HTTP_PROXY_METHOD \
|
#define TEXT_PROXY_METHOD \
|
||||||
_(" --http-proxy-method=METHOD Set the method to use in proxy request.")
|
_(" --proxy-method=METHOD Set the method to use in proxy request.")
|
||||||
#define TEXT_HTTP_AUTH_SCHEME \
|
#define TEXT_HTTP_AUTH_SCHEME \
|
||||||
_(" --http-auth-scheme=SCHEME Set HTTP authentication scheme. Currently, basic\n"\
|
_(" --http-auth-scheme=SCHEME Set HTTP authentication scheme. Currently, basic\n"\
|
||||||
" is the only supported scheme.")
|
" is the only supported scheme.")
|
||||||
|
|
Loading…
Reference in New Issue