diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-07-01 13:45:28 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-07-01 13:45:28 +0000 |
| commit | e6a7c952d1e1812f36968e8c44454c36e10461e2 (patch) | |
| tree | edc93f2b91964d86cd7d3d09599a9f392547a2b8 /src | |
| parent | c3934add2e0f09a452106ca3852eb9c77a5931d2 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/AbstractProxyRequestCommand.cc | 3 | ||||
| -rw-r--r-- | src/AbstractProxyRequestCommand.h | 1 | ||||
| -rw-r--r-- | src/AbstractProxyResponseCommand.cc | 16 | ||||
| -rw-r--r-- | src/AbstractProxyResponseCommand.h | 15 | ||||
| -rw-r--r-- | src/FtpInitiateConnectionCommand.cc | 3 | ||||
| -rw-r--r-- | src/FtpTunnelRequestCommand.cc | 8 | ||||
| -rw-r--r-- | src/FtpTunnelRequestCommand.h | 1 | ||||
| -rw-r--r-- | src/FtpTunnelResponseCommand.cc | 18 | ||||
| -rw-r--r-- | src/FtpTunnelResponseCommand.h | 1 | ||||
| -rw-r--r-- | src/HttpInitiateConnectionCommand.cc | 3 | ||||
| -rw-r--r-- | src/HttpProxyRequestCommand.cc | 8 | ||||
| -rw-r--r-- | src/HttpProxyRequestCommand.h | 1 | ||||
| -rw-r--r-- | src/HttpProxyResponseCommand.cc | 18 | ||||
| -rw-r--r-- | src/HttpProxyResponseCommand.h | 1 |
14 files changed, 63 insertions, 34 deletions
diff --git a/src/AbstractProxyRequestCommand.cc b/src/AbstractProxyRequestCommand.cc index 698f5bb4..bff67fad 100644 --- a/src/AbstractProxyRequestCommand.cc +++ b/src/AbstractProxyRequestCommand.cc @@ -52,12 +52,13 @@ namespace aria2 { AbstractProxyRequestCommand::AbstractProxyRequestCommand (int cuid, const RequestHandle& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<Request>& proxyRequest, const SocketHandle& s) : - AbstractCommand(cuid, req, requestGroup, e, s), + AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), _proxyRequest(proxyRequest), httpConnection(new HttpConnection(cuid, s, getOption().get())) { diff --git a/src/AbstractProxyRequestCommand.h b/src/AbstractProxyRequestCommand.h index c67318dd..d613924a 100644 --- a/src/AbstractProxyRequestCommand.h +++ b/src/AbstractProxyRequestCommand.h @@ -52,6 +52,7 @@ protected: public: AbstractProxyRequestCommand(int cuid, const SharedHandle<Request>& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<Request>& proxyRequest, diff --git a/src/AbstractProxyResponseCommand.cc b/src/AbstractProxyResponseCommand.cc index f6b1ac13..248a7bd3 100644 --- a/src/AbstractProxyResponseCommand.cc +++ b/src/AbstractProxyResponseCommand.cc @@ -49,13 +49,15 @@ namespace aria2 { -AbstractProxyResponseCommand::AbstractProxyResponseCommand(int cuid, - const RequestHandle& req, - RequestGroup* requestGroup, - const HttpConnectionHandle& httpConnection, - DownloadEngine* e, - const SocketHandle& s) - :AbstractCommand(cuid, req, requestGroup, e, s), +AbstractProxyResponseCommand::AbstractProxyResponseCommand +(int cuid, + const RequestHandle& req, + const SharedHandle<FileEntry>& fileEntry, + RequestGroup* requestGroup, + const HttpConnectionHandle& httpConnection, + DownloadEngine* e, + const SocketHandle& s) + :AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), httpConnection(httpConnection) {} AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {} diff --git a/src/AbstractProxyResponseCommand.h b/src/AbstractProxyResponseCommand.h index 28c00c99..bc6ee33a 100644 --- a/src/AbstractProxyResponseCommand.h +++ b/src/AbstractProxyResponseCommand.h @@ -48,12 +48,15 @@ protected: virtual bool executeInternal(); public: - AbstractProxyResponseCommand(int cuid, - const SharedHandle<Request>& req, - RequestGroup* requestGroup, - const SharedHandle<HttpConnection>& httpConnection, - DownloadEngine* e, - const SharedHandle<SocketCore>& s); + AbstractProxyResponseCommand + (int cuid, + const SharedHandle<Request>& req, + const SharedHandle<FileEntry>& fileEntry, + RequestGroup* requestGroup, + const SharedHandle<HttpConnection>& httpConnection, + DownloadEngine* e, + const SharedHandle<SocketCore>& s); + virtual ~AbstractProxyResponseCommand(); virtual Command* getNextCommand() = 0; diff --git a/src/FtpInitiateConnectionCommand.cc b/src/FtpInitiateConnectionCommand.cc index dcfcde6b..8fc880ca 100644 --- a/src/FtpInitiateConnectionCommand.cc +++ b/src/FtpInitiateConnectionCommand.cc @@ -93,7 +93,8 @@ Command* FtpInitiateConnectionCommand::createNextCommand c->setProxyRequest(proxyRequest); command = c; } else if(proxyMethod == V_TUNNEL) { - command = new FtpTunnelRequestCommand(cuid, req, _requestGroup, e, + command = new FtpTunnelRequestCommand(cuid, req, _fileEntry, + _requestGroup, e, proxyRequest, socket); } else { // TODO diff --git a/src/FtpTunnelRequestCommand.cc b/src/FtpTunnelRequestCommand.cc index 73e5ed9c..6df82183 100644 --- a/src/FtpTunnelRequestCommand.cc +++ b/src/FtpTunnelRequestCommand.cc @@ -43,18 +43,22 @@ namespace aria2 { FtpTunnelRequestCommand::FtpTunnelRequestCommand (int cuid, const RequestHandle& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<Request>& proxyRequest, const SocketHandle& s) : - AbstractProxyRequestCommand(cuid, req, requestGroup, e, proxyRequest, s) {} + AbstractProxyRequestCommand(cuid, req, fileEntry, requestGroup, e, + proxyRequest, s) +{} FtpTunnelRequestCommand::~FtpTunnelRequestCommand() {} Command* FtpTunnelRequestCommand::getNextCommand() { - return new FtpTunnelResponseCommand(cuid, req, _requestGroup, httpConnection, e, socket); + return new FtpTunnelResponseCommand + (cuid, req, _fileEntry, _requestGroup, httpConnection, e, socket); } } // namespace aria2 diff --git a/src/FtpTunnelRequestCommand.h b/src/FtpTunnelRequestCommand.h index 9a7fc96f..338a2bab 100644 --- a/src/FtpTunnelRequestCommand.h +++ b/src/FtpTunnelRequestCommand.h @@ -45,6 +45,7 @@ class FtpTunnelRequestCommand : public AbstractProxyRequestCommand { public: FtpTunnelRequestCommand(int cuid, const SharedHandle<Request>& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<Request>& proxyRequest, diff --git a/src/FtpTunnelResponseCommand.cc b/src/FtpTunnelResponseCommand.cc index 0ecb3bd0..de1d4c55 100644 --- a/src/FtpTunnelResponseCommand.cc +++ b/src/FtpTunnelResponseCommand.cc @@ -43,13 +43,17 @@ namespace aria2 { -FtpTunnelResponseCommand::FtpTunnelResponseCommand(int cuid, - const RequestHandle& req, - RequestGroup* requestGroup, - const HttpConnectionHandle& httpConnection, - DownloadEngine* e, - const SocketHandle& s) - :AbstractProxyResponseCommand(cuid, req, requestGroup, httpConnection,e, s) {} +FtpTunnelResponseCommand::FtpTunnelResponseCommand +(int cuid, + const RequestHandle& req, + const SharedHandle<FileEntry>& fileEntry, + RequestGroup* requestGroup, + const HttpConnectionHandle& httpConnection, + DownloadEngine* e, + const SocketHandle& s) + :AbstractProxyResponseCommand(cuid, req, fileEntry, requestGroup, + httpConnection,e, s) +{} FtpTunnelResponseCommand::~FtpTunnelResponseCommand() {} diff --git a/src/FtpTunnelResponseCommand.h b/src/FtpTunnelResponseCommand.h index 1b5c8a8c..704a5dca 100644 --- a/src/FtpTunnelResponseCommand.h +++ b/src/FtpTunnelResponseCommand.h @@ -45,6 +45,7 @@ class FtpTunnelResponseCommand : public AbstractProxyResponseCommand { public: FtpTunnelResponseCommand(int cuid, const SharedHandle<Request>& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, const SharedHandle<HttpConnection>& httpConnection, DownloadEngine* e, diff --git a/src/HttpInitiateConnectionCommand.cc b/src/HttpInitiateConnectionCommand.cc index 4245403a..b34c7aaf 100644 --- a/src/HttpInitiateConnectionCommand.cc +++ b/src/HttpInitiateConnectionCommand.cc @@ -78,7 +78,8 @@ Command* HttpInitiateConnectionCommand::createNextCommand proxyRequest->getPort()); if(proxyMethod == V_TUNNEL) { - command = new HttpProxyRequestCommand(cuid, req, _requestGroup, e, + command = new HttpProxyRequestCommand(cuid, req, _fileEntry, + _requestGroup, e, proxyRequest, socket); } else if(proxyMethod == V_GET) { SharedHandle<HttpConnection> httpConnection diff --git a/src/HttpProxyRequestCommand.cc b/src/HttpProxyRequestCommand.cc index 04e534ee..f55fcc34 100644 --- a/src/HttpProxyRequestCommand.cc +++ b/src/HttpProxyRequestCommand.cc @@ -43,18 +43,22 @@ namespace aria2 { HttpProxyRequestCommand::HttpProxyRequestCommand (int cuid, const RequestHandle& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<Request>& proxyRequest, const SocketHandle& s) : - AbstractProxyRequestCommand(cuid, req, requestGroup, e, proxyRequest, s) {} + AbstractProxyRequestCommand(cuid, req, fileEntry, requestGroup, e, + proxyRequest, s) +{} HttpProxyRequestCommand::~HttpProxyRequestCommand() {} Command* HttpProxyRequestCommand::getNextCommand() { - return new HttpProxyResponseCommand(cuid, req, _requestGroup, httpConnection, e, socket); + return new HttpProxyResponseCommand + (cuid, req, _fileEntry, _requestGroup, httpConnection, e, socket); } } // namespace aria2 diff --git a/src/HttpProxyRequestCommand.h b/src/HttpProxyRequestCommand.h index 31360e80..25dc686c 100644 --- a/src/HttpProxyRequestCommand.h +++ b/src/HttpProxyRequestCommand.h @@ -45,6 +45,7 @@ class HttpProxyRequestCommand : public AbstractProxyRequestCommand { public: HttpProxyRequestCommand(int cuid, const SharedHandle<Request>& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle<Request>& proxyRequest, diff --git a/src/HttpProxyResponseCommand.cc b/src/HttpProxyResponseCommand.cc index be6a58ff..6bf4be5d 100644 --- a/src/HttpProxyResponseCommand.cc +++ b/src/HttpProxyResponseCommand.cc @@ -43,13 +43,17 @@ namespace aria2 { -HttpProxyResponseCommand::HttpProxyResponseCommand(int cuid, - const RequestHandle& req, - RequestGroup* requestGroup, - const HttpConnectionHandle& httpConnection, - DownloadEngine* e, - const SocketHandle& s) - :AbstractProxyResponseCommand(cuid, req, requestGroup, httpConnection, e, s) {} +HttpProxyResponseCommand::HttpProxyResponseCommand +(int cuid, + const RequestHandle& req, + const SharedHandle<FileEntry>& fileEntry, + RequestGroup* requestGroup, + const HttpConnectionHandle& httpConnection, + DownloadEngine* e, + const SocketHandle& s) + :AbstractProxyResponseCommand(cuid, req, fileEntry, requestGroup, + httpConnection, e, s) +{} HttpProxyResponseCommand::~HttpProxyResponseCommand() {} diff --git a/src/HttpProxyResponseCommand.h b/src/HttpProxyResponseCommand.h index 2d9a081f..679f9a17 100644 --- a/src/HttpProxyResponseCommand.h +++ b/src/HttpProxyResponseCommand.h @@ -45,6 +45,7 @@ class HttpProxyResponseCommand : public AbstractProxyResponseCommand { public: HttpProxyResponseCommand(int cuid, const SharedHandle<Request>& req, + const SharedHandle<FileEntry>& fileEntry, RequestGroup* requestGroup, const SharedHandle<HttpConnection>& httpConnection, DownloadEngine* e, |
