Add OPTS command

This commit is contained in:
2019-07-18 13:18:27 +02:00
parent 8c2b32d6b1
commit bac6728971
2 changed files with 26 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ namespace DearFTP.Connection.Commands
new ListCommand(), new ListCommand(),
new ListMachineCommand(), new ListMachineCommand(),
new MakeDirectoryCommand(), new MakeDirectoryCommand(),
new OptionsCommand(),
new ParentDirectoryCommand(), new ParentDirectoryCommand(),
new PassiveCommand(), new PassiveCommand(),
new PwdCommand(), new PwdCommand(),

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace DearFTP.Connection.Commands
{
class OptionsCommand : ICommand
{
public string[] Aliases { get; } = new string[]
{
"OPTS"
};
public void Execute(Session session, FtpStream stream, string alias, string argument)
{
if (argument.ToUpper().Contains("UTF"))
{
stream.Send(ResponseCode.OK, "UTF8 supported on this server.");
return;
}
stream.Send(ResponseCode.ArgumentsError, "Requested option not supported");
}
}
}