View Single Post
Old 09-01-2011, 12:42 PM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

Hmm, I can definitely see how testing would be an issue... You could always do what I do, fire up the latest ioFTPD under the debugger (it only takes 10 min to setup the first time) and drop in some breakpoints ioFTPD releases include the .pdb files so the entire source should be available that way, but you can grab the source release for the individual files as well though building it from scratch isn't something I'd recommend since it's a pain to setup TCL/OpenSSL...

If you do go that route check out SocketAPI.c and the TransmitPackages_* routines, _ReadFile is for sending files, and _SendListBuffer is for sending directory listings and are both called after connections are made and SSL/TLS is finished so it's a good spot to drop a breakpoint. Most FTP commands are in FtpBaseCommands.c if you want to break on something else, and of course I'd be more than happy to point out whatever you're looking for.

For the record ordinary commands like CWD can take a while as well so probably needs a longer timeout if your doing something adaptive. Sometimes reading the directory takes a while if it isn't in cache (much like the directory listing would) and other times I've seen external USB drives take a bit of time to spinup and access data. Not sure why but sometimes that takes 10 seconds on top of whatever the FTP would normally add and that would apply to almost anything like SIZE, MDTM, etc. I'm guessing 30 seconds is usually good, but as I was saying before I don't really see the downside to 2 minutes because the alternative is dropping the control connection and you can always get that behavior doing it manually.
Yil is offline   Reply With Quote