Darin Fisher wrote:

hey daniel,

the ftp state machine logic is all contained in nsFtpConnectionThread.{h,cpp}. don't let the name of these files throw you... there is no FTP thread... anymore :-)

you'll want to find a way to expose these commands. typically, code using FTP interacts with a nsFTPChannel object. so, you might want to add methods to nsIFTPChannel. the flow of operations probably looks something like this:

client creates FTP channel
client configures FTP channel to: delete, mkdir, or rmdir.
client calls AsyncOpen
client waits for OnStartRequest/OnStopRequest to determine success/failure of operation.


this is of course slightly weird since you aren't really opening anything.

Thanks a lot for the reply, Darin; can you please tell if my interpretation below is wrong:

1. add a few methods to nsIFTPChannel
2. add the corresponding to nsFTPChannel.cpp, those setting a private
   attribute on the nsFTPChannel
3. pass those attributes to the nsFtpState in nsFTPChannel::SetupState()
4. for instance for file deletion, I can add a new FTP_ACTION called DEL
5. add to nsFtpState the methods corresponding to those defined in
   item 2 above
6. add a switch on mAction == DEL to nsFtpState::R_pasv() and R_cwd()
7. code nsFtpState::S_del() and nsFtpState::R_del()

Do I miss something ?

</Daniel>


_______________________________________________ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to