Currently, to add some custom commands to the TFtpServer, there're only 
two possibilities:
- use the OnClientCommand event
- override the TFtpServer and override the TriggerClientCommand

Those two possibilities had the same problem: we have to put exactly 
(approximately) the same code as the ClientCommand procedure (at least)
My intention is to permit use the AddCommand procedure to avoid this and 
simplify overriding TFtpServer.

This problem is, at least, because FCmdTable is a static array. In the 
way to change it to a TList, I found some strange things in the code:

First, in FtpSrvC, i found this:
 ftpcLast = 31;   {angus used to dimension FCmdTable, note it needs to 
be 5 larger}
 ftpcAUTH = 32;
 ftpcPROT = 33;
 ftpcLast = 33;

ftpcLast is only used to size the FCmdTable array. Nowhere else.
- why two declarations? (may be for SSL but it seems not)
- why 5? while it seems there're only two new commands for SSL (AUTH and 
PROT).... which are not added to the FCmdTable with AddCommand (at least 
in TFtpServer)

Second, in most of command triggers, the outline is:

procedure CommandXXX; virtual;
   // prepare command
   // trigger client event
   // process command if not done by event
   on E:Exception do begin
     Answer := Format(msgXXXFailed, [E.Message])

if we override this, the only possibility to know if inherited procedure 
had raise an exception is to parse the Answer parameter.
Did I miss something?

(Sorry about my "frenchy" english)

Best regards, Tetram
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to