Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=13343
There are some Industrial Automation Hardware devices which return a
'\'-prefixed path to the FTP PWD command, which would break:
System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.Parse (UriKind kind, System.String uriString)
at System.Uri.ParseUri (UriKind kind)
at System.Uri..ctor (System.String uriString, Boolean dontEscape)
at System.Uri..ctor (System.String uriString) [0x0000
at System.Net.FtpWebRequest.GetRemoteFolderPath (System.Uri uri)
at System.Net.FtpWebRequest.CWDAndSetFileName (System.Uri uri)
at System.Net.FtpWebRequest.ProcessMethod ()
at System.Net.FtpWebRequest.ProcessRequest ()
There was an error connecting to the FTP Server.
The problem was this statement:
Uri initial = new Uri ("ftp://dummy-host" + initial_path);
Since the FTP server was returning "\" to the PWD command,
`initial_path` was "\", and the above was equivalent to:
Uri initial = new Uri (@"ftp://dummy-host\");
This results in the UriFormatException.
The solution is to not assume that `initial_path` will start with '/',
and instead use UriBuilder.
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
* FtpDataStream.cs:
* FtpWebRequest.cs: properly close the data connection even when
nothing is read from it. Refixes bug #598908.
svn path=/trunk/mcs/; revision=157506
* FtpDataStream.cs:
* FtpWebRequest.cs: use streams instead of sockets as soon as
possible. Correctly initialize the control connection when SSL
is used.
Fixes bug #598908.
svn path=/trunk/mcs/; revision=156028
* FtpWebResponse.cs:
* FtpWebRequest.cs: for non-data operations, make sure we send the
QUIT command upon completion when KeepAlive is false.
Fixes bug #589305.
svn path=/trunk/mcs/; revision=153825
* FtpWebRequest.cs: avoid exception when the reply from the server
contains just response code. Fixes bug #510852.
svn path=/trunk/mcs/; revision=135695
* FtpWebResponse.cs: return a Null stream when there's no response to
be read.
* FtpWebRequest.cs: provide the error returned by the server in the
exception.
* WebClient.cs: set the correct method when doing a FTP upload.
Fixes bug #478451.
svn path=/trunk/mcs/; revision=127640
* FtpWebRequest.cs: avoid errors when creating a temporary Uri to get
the local path.
* WebClient.cs: when setting up the request for downloading, use the
default method. Fixes bug #477611.
svn path=/trunk/mcs/; revision=127449
* FtpDataStream.cs: use the socket for reading until the end of a
stream that wasn't read entirely. Remove unused ManualResetEvent.
* FtpWebRequest.cs: set the file_name when downloading. Update the
response status after every SendCommand. Send a "OPTS utf8 on" as MS
does (the control cnc reader should do something with UTF8)
svn path=/trunk/mcs/; revision=118783
* FtpWebRequest.cs: take the server current directory into account
when uploading files. Set the data connection type before every
transmission.
Bug 333985 fixed.
svn path=/trunk/mcs/; revision=117841
* FtpWebRequest.cs: disable keep-alive connections as the current code
does not deal with keep-alive connections.
Workaround for bug #380262.
svn path=/trunk/mcs/; revision=117608
* WebClient.cs (DownloadFileCore): use longs for the
ContentLength, although the other code (loading into a byte array,
or a string) still uses ints, the DownloadFileCore should not.
2007-12-11 Miguel de Icaza <[email protected]>
* WebClient.cs:
Lots of fixes to get the *Async methods to work.
* WebClient.cs: async, new boolean flag, used to track whether we
are an async invocation, and if so, we need to invoke some
methods.
Switch to using System.Threading.Thread instead of the ThreadPool
as there is no way with the ThreadPool to abort threads (to
implemente CancelAsync).
(CompleteAsync): Helper method used to clear the state after an
async operation completes, otherwise the WebClient can only be
used once.
(CancelAsync): Use Thread.Interrupt to signal the thread that we
are aborting it (it is a lot milder than Thread.Abort, and we are
in no rush to cancel this anyways); Also the documentation states
that we need to call the WebRequest.Abort method, so we do that in
every Download instance.
(DownloadDataAsync, DownloadFileAsync, DownloadStringAsync,
OpenReadAsync, OpenWriteAsync, UplaodDataAsync, UploadFileAsync,
UploadStringAsync): Make signature parameters match MS; use
threads instead of threadpool (so we can implement CancelAsync),
catch ThreadAbortException here so we can also raise the proper
DownloadDataCompleteEventArgs.
These routines will also call the WebRequest.Abort when
appropriate when ThreadInterrupted is used.
(ReadAll): Raise DownloadProgressChanged events.
svn path=/trunk/mcs/; revision=91142
* FtpWebRequest.cs (GetResponseStatus): Fix this routine
propertly, refactor, and make it follow Mono coding conventions.
svn path=/trunk/mcs/; revision=88820
* FtpDataStream.cs: FTP request is now working and covers about 100% of .NET API
* FtpWebRequest.cs: FTP request is now working and covers about 100% of .NET API
* FtpWebResponse.cs: FTP request is now working and covers about 100% of .NET API
* FtpStatus.cs: added composite status (includes status code and status description)
svn path=/trunk/mcs/; revision=69647
from CreateExceptionFromResponse, since exceptions gotten
from server response always have a WebExceptionStatus.ProtocolError
value.
2006-02-08 Carlos Alberto Cortez <[email protected]>
svn path=/trunk/mcs/; revision=56694
methods, to search using Array.BinarySearch. Remove CheckMethod.
2006-02-01 Carlos Alberto Cortez <[email protected]>
svn path=/trunk/mcs/; revision=56557