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>
 | 
			
		||||
 | 
			
		||||
	Use SegmentMan::getSegment(cuid) for single file download.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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()))
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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() {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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() {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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() {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue