[Mono-devel-list] [PATCH] System.Net.FtpWebRequest

Miguel de Icaza miguel at ximian.com
Sun Jun 26 14:28:06 EDT 2005


Hello,

   Excellent work Martin.

   I have attached a few comments:

> 4.) I did XML doc for it all - don't know how much that helps....

In Mono we tend not to use the inline-XML documentation, and instead we
put the documentation on a separate file.   Could you resend the code
without XML comments?

The comments we can reuse in Monodoc (install your new libraries, and
run the monodocer command).

> 5.) I haven't modified it so that you don't need to do .RegisterPrefix
> (and am not sure how either)

Am confused about that.

> The main classes (FtpAsyncResult, FtpWebRequest, FtpWebResponse, FtpEnums)
> FtpTest.cs - a usage example - takes ftp:// or ftps:// as cmd line arg
> and connects, lists the dir etc...
> FtpWebRequestTest.cs - a VERY basic test class - it will test you
> didn't completely break it but not much else yet - I'll do more later.

I have not looked very closely to the code, but a few things are worth
mentioning:

	* The abort code does not prepare the socket to send an
	  Out-of-Band message before it sends the abort.

	* The abort code I think is "ABOR", not "ABORT"

	* Although there are properties for setting binary transfer,
	  there does not seem to be any code to actually change the
	  transfer mode, since the default in most servers is ASCII
	  this probably will cause trouble.

	* When changing properties of a connection, maybe the code
	  should queue changes (unless the MS.NET implementation does
	  it differently), for example, it should be possible to
	  change the binary mode while a transfer is in progress.

	  On the next operation, it could send all of the pending
	  changes down the line.

	* The code does not seem to handle broken communications,
	  for instance, consider the "SendCommand" routine, it 
	  should probably loop around:

           net.Write(sendBuffer, 0, sendBuffer.GetLength(0));                                                              

	  And catch errors;  And if an error happens while sending
	  the command or receiving the reply, it should throw the
	  proper exception (or try to recover, not sure what MS
	  does here).

I have attached the source code to the ftp client that is used in the
Midnight Commander which might be useful as a reference for
miss-behaving ftp sites.  The code has extra stuff that you can safely
ignore, but the underlying ftp client should be a good reference.

Miguel.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftpfs.c
Type: text/x-csrc
Size: 53184 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050626/0538ee68/attachment.bin 


More information about the Mono-devel-list mailing list