mirror of https://github.com/aria2/aria2
2009-07-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Get proxy download working * src/AbstractProxyRequestCommand.cc * src/AbstractProxyRequestCommand.h * src/AbstractProxyResponseCommand.cc * src/AbstractProxyResponseCommand.h * src/FtpInitiateConnectionCommand.cc * src/FtpTunnelRequestCommand.cc * src/FtpTunnelRequestCommand.h * src/FtpTunnelResponseCommand.cc * src/FtpTunnelResponseCommand.h * src/HttpInitiateConnectionCommand.cc * src/HttpProxyRequestCommand.cc * src/HttpProxyRequestCommand.h * src/HttpProxyResponseCommand.cc * src/HttpProxyResponseCommand.hpull/1/head
parent
c3934add2e
commit
e6a7c952d1
18
ChangeLog
18
ChangeLog
|
@ -1,3 +1,21 @@
|
||||||
|
2009-07-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Get proxy download working
|
||||||
|
* src/AbstractProxyRequestCommand.cc
|
||||||
|
* src/AbstractProxyRequestCommand.h
|
||||||
|
* src/AbstractProxyResponseCommand.cc
|
||||||
|
* src/AbstractProxyResponseCommand.h
|
||||||
|
* src/FtpInitiateConnectionCommand.cc
|
||||||
|
* src/FtpTunnelRequestCommand.cc
|
||||||
|
* src/FtpTunnelRequestCommand.h
|
||||||
|
* src/FtpTunnelResponseCommand.cc
|
||||||
|
* src/FtpTunnelResponseCommand.h
|
||||||
|
* src/HttpInitiateConnectionCommand.cc
|
||||||
|
* src/HttpProxyRequestCommand.cc
|
||||||
|
* src/HttpProxyRequestCommand.h
|
||||||
|
* src/HttpProxyResponseCommand.cc
|
||||||
|
* src/HttpProxyResponseCommand.h
|
||||||
|
|
||||||
2009-07-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-07-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Use SegmentMan::getSegment(cuid) for single file download.
|
Use SegmentMan::getSegment(cuid) for single file download.
|
||||||
|
|
|
@ -52,12 +52,13 @@ namespace aria2 {
|
||||||
AbstractProxyRequestCommand::AbstractProxyRequestCommand
|
AbstractProxyRequestCommand::AbstractProxyRequestCommand
|
||||||
(int cuid,
|
(int cuid,
|
||||||
const RequestHandle& req,
|
const RequestHandle& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
const SharedHandle<Request>& proxyRequest,
|
const SharedHandle<Request>& proxyRequest,
|
||||||
const SocketHandle& s)
|
const SocketHandle& s)
|
||||||
:
|
:
|
||||||
AbstractCommand(cuid, req, requestGroup, e, s),
|
AbstractCommand(cuid, req, fileEntry, requestGroup, e, s),
|
||||||
_proxyRequest(proxyRequest),
|
_proxyRequest(proxyRequest),
|
||||||
httpConnection(new HttpConnection(cuid, s, getOption().get()))
|
httpConnection(new HttpConnection(cuid, s, getOption().get()))
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,6 +52,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
AbstractProxyRequestCommand(int cuid,
|
AbstractProxyRequestCommand(int cuid,
|
||||||
const SharedHandle<Request>& req,
|
const SharedHandle<Request>& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
const SharedHandle<Request>& proxyRequest,
|
const SharedHandle<Request>& proxyRequest,
|
||||||
|
|
|
@ -49,13 +49,15 @@
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
AbstractProxyResponseCommand::AbstractProxyResponseCommand(int cuid,
|
AbstractProxyResponseCommand::AbstractProxyResponseCommand
|
||||||
const RequestHandle& req,
|
(int cuid,
|
||||||
RequestGroup* requestGroup,
|
const RequestHandle& req,
|
||||||
const HttpConnectionHandle& httpConnection,
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
DownloadEngine* e,
|
RequestGroup* requestGroup,
|
||||||
const SocketHandle& s)
|
const HttpConnectionHandle& httpConnection,
|
||||||
:AbstractCommand(cuid, req, requestGroup, e, s),
|
DownloadEngine* e,
|
||||||
|
const SocketHandle& s)
|
||||||
|
:AbstractCommand(cuid, req, fileEntry, requestGroup, e, s),
|
||||||
httpConnection(httpConnection) {}
|
httpConnection(httpConnection) {}
|
||||||
|
|
||||||
AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {}
|
AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {}
|
||||||
|
|
|
@ -48,12 +48,15 @@ protected:
|
||||||
|
|
||||||
virtual bool executeInternal();
|
virtual bool executeInternal();
|
||||||
public:
|
public:
|
||||||
AbstractProxyResponseCommand(int cuid,
|
AbstractProxyResponseCommand
|
||||||
const SharedHandle<Request>& req,
|
(int cuid,
|
||||||
RequestGroup* requestGroup,
|
const SharedHandle<Request>& req,
|
||||||
const SharedHandle<HttpConnection>& httpConnection,
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
DownloadEngine* e,
|
RequestGroup* requestGroup,
|
||||||
const SharedHandle<SocketCore>& s);
|
const SharedHandle<HttpConnection>& httpConnection,
|
||||||
|
DownloadEngine* e,
|
||||||
|
const SharedHandle<SocketCore>& s);
|
||||||
|
|
||||||
virtual ~AbstractProxyResponseCommand();
|
virtual ~AbstractProxyResponseCommand();
|
||||||
|
|
||||||
virtual Command* getNextCommand() = 0;
|
virtual Command* getNextCommand() = 0;
|
||||||
|
|
|
@ -93,7 +93,8 @@ Command* FtpInitiateConnectionCommand::createNextCommand
|
||||||
c->setProxyRequest(proxyRequest);
|
c->setProxyRequest(proxyRequest);
|
||||||
command = c;
|
command = c;
|
||||||
} else if(proxyMethod == V_TUNNEL) {
|
} else if(proxyMethod == V_TUNNEL) {
|
||||||
command = new FtpTunnelRequestCommand(cuid, req, _requestGroup, e,
|
command = new FtpTunnelRequestCommand(cuid, req, _fileEntry,
|
||||||
|
_requestGroup, e,
|
||||||
proxyRequest, socket);
|
proxyRequest, socket);
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
|
@ -43,18 +43,22 @@ namespace aria2 {
|
||||||
FtpTunnelRequestCommand::FtpTunnelRequestCommand
|
FtpTunnelRequestCommand::FtpTunnelRequestCommand
|
||||||
(int cuid,
|
(int cuid,
|
||||||
const RequestHandle& req,
|
const RequestHandle& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
const SharedHandle<Request>& proxyRequest,
|
const SharedHandle<Request>& proxyRequest,
|
||||||
const SocketHandle& s)
|
const SocketHandle& s)
|
||||||
:
|
:
|
||||||
AbstractProxyRequestCommand(cuid, req, requestGroup, e, proxyRequest, s) {}
|
AbstractProxyRequestCommand(cuid, req, fileEntry, requestGroup, e,
|
||||||
|
proxyRequest, s)
|
||||||
|
{}
|
||||||
|
|
||||||
FtpTunnelRequestCommand::~FtpTunnelRequestCommand() {}
|
FtpTunnelRequestCommand::~FtpTunnelRequestCommand() {}
|
||||||
|
|
||||||
Command* FtpTunnelRequestCommand::getNextCommand()
|
Command* FtpTunnelRequestCommand::getNextCommand()
|
||||||
{
|
{
|
||||||
return new FtpTunnelResponseCommand(cuid, req, _requestGroup, httpConnection, e, socket);
|
return new FtpTunnelResponseCommand
|
||||||
|
(cuid, req, _fileEntry, _requestGroup, httpConnection, e, socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -45,6 +45,7 @@ class FtpTunnelRequestCommand : public AbstractProxyRequestCommand {
|
||||||
public:
|
public:
|
||||||
FtpTunnelRequestCommand(int cuid,
|
FtpTunnelRequestCommand(int cuid,
|
||||||
const SharedHandle<Request>& req,
|
const SharedHandle<Request>& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
const SharedHandle<Request>& proxyRequest,
|
const SharedHandle<Request>& proxyRequest,
|
||||||
|
|
|
@ -43,13 +43,17 @@
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
FtpTunnelResponseCommand::FtpTunnelResponseCommand(int cuid,
|
FtpTunnelResponseCommand::FtpTunnelResponseCommand
|
||||||
const RequestHandle& req,
|
(int cuid,
|
||||||
RequestGroup* requestGroup,
|
const RequestHandle& req,
|
||||||
const HttpConnectionHandle& httpConnection,
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
DownloadEngine* e,
|
RequestGroup* requestGroup,
|
||||||
const SocketHandle& s)
|
const HttpConnectionHandle& httpConnection,
|
||||||
:AbstractProxyResponseCommand(cuid, req, requestGroup, httpConnection,e, s) {}
|
DownloadEngine* e,
|
||||||
|
const SocketHandle& s)
|
||||||
|
:AbstractProxyResponseCommand(cuid, req, fileEntry, requestGroup,
|
||||||
|
httpConnection,e, s)
|
||||||
|
{}
|
||||||
|
|
||||||
FtpTunnelResponseCommand::~FtpTunnelResponseCommand() {}
|
FtpTunnelResponseCommand::~FtpTunnelResponseCommand() {}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ class FtpTunnelResponseCommand : public AbstractProxyResponseCommand {
|
||||||
public:
|
public:
|
||||||
FtpTunnelResponseCommand(int cuid,
|
FtpTunnelResponseCommand(int cuid,
|
||||||
const SharedHandle<Request>& req,
|
const SharedHandle<Request>& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
const SharedHandle<HttpConnection>& httpConnection,
|
const SharedHandle<HttpConnection>& httpConnection,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
|
|
|
@ -78,7 +78,8 @@ Command* HttpInitiateConnectionCommand::createNextCommand
|
||||||
proxyRequest->getPort());
|
proxyRequest->getPort());
|
||||||
|
|
||||||
if(proxyMethod == V_TUNNEL) {
|
if(proxyMethod == V_TUNNEL) {
|
||||||
command = new HttpProxyRequestCommand(cuid, req, _requestGroup, e,
|
command = new HttpProxyRequestCommand(cuid, req, _fileEntry,
|
||||||
|
_requestGroup, e,
|
||||||
proxyRequest, socket);
|
proxyRequest, socket);
|
||||||
} else if(proxyMethod == V_GET) {
|
} else if(proxyMethod == V_GET) {
|
||||||
SharedHandle<HttpConnection> httpConnection
|
SharedHandle<HttpConnection> httpConnection
|
||||||
|
|
|
@ -43,18 +43,22 @@ namespace aria2 {
|
||||||
HttpProxyRequestCommand::HttpProxyRequestCommand
|
HttpProxyRequestCommand::HttpProxyRequestCommand
|
||||||
(int cuid,
|
(int cuid,
|
||||||
const RequestHandle& req,
|
const RequestHandle& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
const SharedHandle<Request>& proxyRequest,
|
const SharedHandle<Request>& proxyRequest,
|
||||||
const SocketHandle& s)
|
const SocketHandle& s)
|
||||||
:
|
:
|
||||||
AbstractProxyRequestCommand(cuid, req, requestGroup, e, proxyRequest, s) {}
|
AbstractProxyRequestCommand(cuid, req, fileEntry, requestGroup, e,
|
||||||
|
proxyRequest, s)
|
||||||
|
{}
|
||||||
|
|
||||||
HttpProxyRequestCommand::~HttpProxyRequestCommand() {}
|
HttpProxyRequestCommand::~HttpProxyRequestCommand() {}
|
||||||
|
|
||||||
Command* HttpProxyRequestCommand::getNextCommand()
|
Command* HttpProxyRequestCommand::getNextCommand()
|
||||||
{
|
{
|
||||||
return new HttpProxyResponseCommand(cuid, req, _requestGroup, httpConnection, e, socket);
|
return new HttpProxyResponseCommand
|
||||||
|
(cuid, req, _fileEntry, _requestGroup, httpConnection, e, socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -45,6 +45,7 @@ class HttpProxyRequestCommand : public AbstractProxyRequestCommand {
|
||||||
public:
|
public:
|
||||||
HttpProxyRequestCommand(int cuid,
|
HttpProxyRequestCommand(int cuid,
|
||||||
const SharedHandle<Request>& req,
|
const SharedHandle<Request>& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
const SharedHandle<Request>& proxyRequest,
|
const SharedHandle<Request>& proxyRequest,
|
||||||
|
|
|
@ -43,13 +43,17 @@
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
HttpProxyResponseCommand::HttpProxyResponseCommand(int cuid,
|
HttpProxyResponseCommand::HttpProxyResponseCommand
|
||||||
const RequestHandle& req,
|
(int cuid,
|
||||||
RequestGroup* requestGroup,
|
const RequestHandle& req,
|
||||||
const HttpConnectionHandle& httpConnection,
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
DownloadEngine* e,
|
RequestGroup* requestGroup,
|
||||||
const SocketHandle& s)
|
const HttpConnectionHandle& httpConnection,
|
||||||
:AbstractProxyResponseCommand(cuid, req, requestGroup, httpConnection, e, s) {}
|
DownloadEngine* e,
|
||||||
|
const SocketHandle& s)
|
||||||
|
:AbstractProxyResponseCommand(cuid, req, fileEntry, requestGroup,
|
||||||
|
httpConnection, e, s)
|
||||||
|
{}
|
||||||
|
|
||||||
HttpProxyResponseCommand::~HttpProxyResponseCommand() {}
|
HttpProxyResponseCommand::~HttpProxyResponseCommand() {}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ class HttpProxyResponseCommand : public AbstractProxyResponseCommand {
|
||||||
public:
|
public:
|
||||||
HttpProxyResponseCommand(int cuid,
|
HttpProxyResponseCommand(int cuid,
|
||||||
const SharedHandle<Request>& req,
|
const SharedHandle<Request>& req,
|
||||||
|
const SharedHandle<FileEntry>& fileEntry,
|
||||||
RequestGroup* requestGroup,
|
RequestGroup* requestGroup,
|
||||||
const SharedHandle<HttpConnection>& httpConnection,
|
const SharedHandle<HttpConnection>& httpConnection,
|
||||||
DownloadEngine* e,
|
DownloadEngine* e,
|
||||||
|
|
Loading…
Reference in New Issue