Add EPSV command
This commit is contained in:
@@ -12,6 +12,7 @@ namespace DearFTP.Connection.Commands
|
||||
new ClntCommand(),
|
||||
new CwdCommand(),
|
||||
new DeleteCommand(),
|
||||
new ExtendedPassiveCommand(),
|
||||
new HelpCommand(),
|
||||
new FeaturesCommand(),
|
||||
new FileModificationTimeCommand(),
|
||||
|
||||
26
DearFTP/Connection/Commands/ExtendedPassiveCommand.cs
Normal file
26
DearFTP/Connection/Commands/ExtendedPassiveCommand.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DearFTP.Connection.Commands
|
||||
{
|
||||
class ExtendedPassiveCommand : ICommand
|
||||
{
|
||||
public string[] Aliases { get; } = new string[]
|
||||
{
|
||||
"EPSV"
|
||||
};
|
||||
|
||||
public void Execute(Session session, FtpStream stream, string alias, string argument)
|
||||
{
|
||||
session.DataConnection.Create();
|
||||
|
||||
int port = session.DataConnection.Port;
|
||||
|
||||
stream.Send(ResponseCode.ExtendedPassiveMode, $"Entering Extended Passive Mode (|||{port}|)");
|
||||
|
||||
session.DataConnection.AcceptClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
"CDUP",
|
||||
"CWD",
|
||||
"DELE",
|
||||
"EPSV",
|
||||
"FEAT",
|
||||
"HELP",
|
||||
"LIST",
|
||||
|
||||
Reference in New Issue
Block a user