Add EPSV command

This commit is contained in:
2019-07-27 20:26:10 +02:00
parent 351030ebcd
commit f81d09d540
3 changed files with 28 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ namespace DearFTP.Connection.Commands
new ClntCommand(),
new CwdCommand(),
new DeleteCommand(),
new ExtendedPassiveCommand(),
new HelpCommand(),
new FeaturesCommand(),
new FileModificationTimeCommand(),

View 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();
}
}
}

View File

@@ -22,6 +22,7 @@
"CDUP",
"CWD",
"DELE",
"EPSV",
"FEAT",
"HELP",
"LIST",