Commit Graph
7 Commits
Author SHA1 Message Date
Jonathan Pryor f9d78260db [System] Support FTP download where PWD starts with '\'.
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.
2013-07-25 11:38:09 -04:00
Gonzalo Paniagua Javier 4181e28735 2009-01-16 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequestTest.cs: add directory listing test when the $HOME is
	not /.


svn path=/trunk/mcs/; revision=123616
2009-01-16 15:40:23 +00:00
Gonzalo Paniagua Javier b5ac5d886d 2009-01-12 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequestTest.cs: test deleting a file.


svn path=/trunk/mcs/; revision=123136
2009-01-12 22:03:32 +00:00
Gonzalo Paniagua Javier 96679ba6ec 2008-11-13 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequestTest.cs: the upload test now passes with the MS
	runtime. Added another test for download.


svn path=/trunk/mcs/; revision=118784
2008-11-13 22:56:58 +00:00
Gonzalo Paniagua Javier 8f1e89a022 2008-11-03 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequestTest.cs: add test for bug 333985.


svn path=/trunk/mcs/; revision=117839
2008-11-04 03:05:45 +00:00
Carlos Alberto Cortez 34dfa0d660 2006-02-03 Carlos Alberto Cortez <[email protected]>
* FtpWebRequestTest.cs: Add a small check for Method.
	

svn path=/trunk/mcs/; revision=56558
2006-02-04 02:42:05 +00:00
Carlos Alberto Cortez 2a026bcef6 2006-02-03 Carlos Alberto Cortez <[email protected]>
* FtpWebRequestTest.cs: New file to test properties/methods
	that don't need any connection to work.
	

svn path=/trunk/mcs/; revision=56515
2006-02-03 10:19:06 +00:00