diff --git a/DearFTP/Connection/Commands/CommandsDispatcher.cs b/DearFTP/Connection/Commands/CommandsDispatcher.cs index 20cb3f1..5abb58d 100644 --- a/DearFTP/Connection/Commands/CommandsDispatcher.cs +++ b/DearFTP/Connection/Commands/CommandsDispatcher.cs @@ -12,6 +12,7 @@ namespace DearFTP.Connection.Commands new ClntCommand(), new CwdCommand(), new DeleteCommand(), + new ExtendedPassiveCommand(), new HelpCommand(), new FeaturesCommand(), new FileModificationTimeCommand(), diff --git a/DearFTP/Connection/Commands/ExtendedPassiveCommand.cs b/DearFTP/Connection/Commands/ExtendedPassiveCommand.cs new file mode 100644 index 0000000..3782b36 --- /dev/null +++ b/DearFTP/Connection/Commands/ExtendedPassiveCommand.cs @@ -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(); + } + } +} diff --git a/DearFTP/Connection/Commands/HelpCommand.cs b/DearFTP/Connection/Commands/HelpCommand.cs index dcfa267..f071722 100644 --- a/DearFTP/Connection/Commands/HelpCommand.cs +++ b/DearFTP/Connection/Commands/HelpCommand.cs @@ -22,6 +22,7 @@ "CDUP", "CWD", "DELE", + "EPSV", "FEAT", "HELP", "LIST",