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: {$IFNDEF USE_SSL} ftpcLast = 31; {angus used to dimension FCmdTable, note it needs to be 5 larger} {$ELSE} ftpcAUTH = 32; ftpcPROT = 33; ftpcLast = 33; {$ENDIF} ftpcLast is only used to size the FCmdTable array. Nowhere else. So: - 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; begin try // prepare command // trigger client event // process command if not done by event except on E:Exception do begin Answer := Format(msgXXXFailed, [E.Message]) end; end; end; 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 http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be