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

Martin Hinks mhinks at gmail.com
Mon Jun 27 04:37:46 EDT 2005

Ok, here's a version with those comments taken into account:

Also, need to add these lines to the mono supplied machine.config
under <webRequestModules> to do RegisterPrefix:

<add prefix="ftp" type="System.Net.FtpWebRequestCreator, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
<add prefix="ftps" type="System.Net.FtpWebRequestCreator, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

:No XML Comments
:Has error handling on SendCommand - throws an error saying connection lost
:No change to behaviour of changing property
:Abort code changed
:Mode change settings added

Please review patch :)


On 6/26/05, Miguel de Icaza <miguel at ximian.com> wrote:
> 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.

Martin Hinks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FtpWebRequest.zip
Type: application/zip
Size: 16481 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050627/0a680d40/attachment.zip 

More information about the Mono-devel-list mailing list