mirror of https://github.com/aria2/aria2
sftp: Make sftp works through HTTP proxy
parent
d0ad7033c3
commit
21c328fc11
|
@ -132,18 +132,31 @@ std::unique_ptr<Command> FtpInitiateConnectionCommand::createNextCommandProxied
|
||||||
|
|
||||||
setConnectedAddrInfo(getRequest(), hostname, pooledSocket);
|
setConnectedAddrInfo(getRequest(), hostname, pooledSocket);
|
||||||
if(proxyMethod == V_TUNNEL) {
|
if(proxyMethod == V_TUNNEL) {
|
||||||
|
if (getRequest()->getProtocol() == "sftp") {
|
||||||
|
return make_unique<SftpNegotiationCommand>
|
||||||
|
(getCuid(),
|
||||||
|
getRequest(),
|
||||||
|
getFileEntry(),
|
||||||
|
getRequestGroup(),
|
||||||
|
getDownloadEngine(),
|
||||||
|
pooledSocket,
|
||||||
|
SftpNegotiationCommand::SEQ_SFTP_OPEN);
|
||||||
|
}
|
||||||
|
|
||||||
// options contains "baseWorkingDir"
|
// options contains "baseWorkingDir"
|
||||||
return make_unique<FtpNegotiationCommand>
|
return make_unique<FtpNegotiationCommand>
|
||||||
(getCuid(),
|
(getCuid(),
|
||||||
getRequest(),
|
getRequest(),
|
||||||
getFileEntry(),
|
getFileEntry(),
|
||||||
getRequestGroup(),
|
getRequestGroup(),
|
||||||
getDownloadEngine(),
|
getDownloadEngine(),
|
||||||
pooledSocket,
|
pooledSocket,
|
||||||
FtpNegotiationCommand::SEQ_SEND_CWD_PREP,
|
FtpNegotiationCommand::SEQ_SEND_CWD_PREP,
|
||||||
options);
|
options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(getRequest()->getProtocol() == "ftp");
|
||||||
|
|
||||||
if(proxyMethod != V_GET) {
|
if(proxyMethod != V_GET) {
|
||||||
assert(0);
|
assert(0);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "Segment.h"
|
#include "Segment.h"
|
||||||
#include "SocketCore.h"
|
#include "SocketCore.h"
|
||||||
#include "SocketRecvBuffer.h"
|
#include "SocketRecvBuffer.h"
|
||||||
|
#include "SftpNegotiationCommand.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -59,6 +60,13 @@ FtpTunnelResponseCommand::~FtpTunnelResponseCommand() {}
|
||||||
|
|
||||||
std::unique_ptr<Command> FtpTunnelResponseCommand::getNextCommand()
|
std::unique_ptr<Command> FtpTunnelResponseCommand::getNextCommand()
|
||||||
{
|
{
|
||||||
|
if (getRequest()->getProtocol() == "sftp") {
|
||||||
|
return make_unique<SftpNegotiationCommand>
|
||||||
|
(getCuid(), getRequest(), getFileEntry(),
|
||||||
|
getRequestGroup(), getDownloadEngine(),
|
||||||
|
getSocket());
|
||||||
|
}
|
||||||
|
|
||||||
return make_unique<FtpNegotiationCommand>
|
return make_unique<FtpNegotiationCommand>
|
||||||
(getCuid(), getRequest(), getFileEntry(),
|
(getCuid(), getRequest(), getFileEntry(),
|
||||||
getRequestGroup(), getDownloadEngine(),
|
getRequestGroup(), getDownloadEngine(),
|
||||||
|
|
Loading…
Reference in New Issue