Commit Graph
41 Commits
Author SHA1 Message Date
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
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
Marek Safar 5aeeb9cf7b Fix few warnings 2013-02-25 19:10:09 +01:00
Miguel de Icaza f48ceb9860 [System] Removal of the NET_2_0 in the source code
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.
2012-06-02 13:16:40 -04:00
Gonzalo Paniagua Javier cf20cad809 Use the right socket for the data stream
This fixes bug active data connections.
	Fixes xamarin bug #1294.
2012-01-10 16:34:26 -05:00
Martin be6b88bc1c Do not throw an exception if Proxy is set to null. Compare this implementation to HttpWebRequest.Proxy. 2011-10-25 10:55:10 +03:00
Gonzalo Paniagua Javier 1ac0557bfc Support FTP + RETR + proxy
Fixes bug #690887.
2011-04-30 11:07:56 +02:00
Gonzalo Paniagua Javier 32375f7136 2010-05-18 Gonzalo Paniagua Javier <[email protected]>
* 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
2010-05-18 16:58:15 +00:00
Gonzalo Paniagua Javier 641218b6a4 2010-04-23 Gonzalo Paniagua Javier <[email protected]>
* 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
2010-04-23 19:37:26 +00:00
Gonzalo Paniagua Javier 9a1d4113e1 2010-03-18 Gonzalo Paniagua Javier <[email protected]>
* 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
2010-03-18 11:59:29 +00:00
Gonzalo Paniagua Javier 067efbfbd7 2009-06-08 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: avoid exception when the reply from the server
	contains just response code. Fixes bug #510852.


svn path=/trunk/mcs/; revision=135695
2009-06-08 20:48:03 +00:00
Gonzalo Paniagua Javier 5159f09ae4 2009-04-06 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: send REST after PASV to avoid some servers
	forgetting aboout it.
	Bug #491590 fixed.


svn path=/trunk/mcs/; revision=131180
2009-04-07 00:05:35 +00:00
Gonzalo Paniagua Javier abfa80f6bd 2009-03-24 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: we were sending CWD instead of PWD.
	Bug #486703 fixed.


svn path=/trunk/mcs/; revision=130157
2009-03-24 21:07:44 +00:00
Gonzalo Paniagua Javier f65e2cc9cc 2009-02-21 Gonzalo Paniagua Javier <[email protected]>
* 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
2009-02-21 23:30:00 +00:00
Gonzalo Paniagua Javier c0bc4cf75d 2009-02-19 Gonzalo Paniagua Javier <[email protected]>
* 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
2009-02-19 20:13:58 +00:00
Gonzalo Paniagua Javier 6f5b93b2d2 2009-02-06 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: some servers have a comment after the directory
	name. Fixes bugs #471149 and #471216.


svn path=/trunk/mcs/; revision=126101
2009-02-06 20:18:50 +00:00
Gonzalo Paniagua Javier 12ad10aa49 2009-01-16 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: adjust to the correct directory when listing too.
	Fixes bug #466530.


svn path=/trunk/mcs/; revision=123614
2009-01-16 15:38:56 +00:00
Gonzalo Paniagua Javier 93a5d755a7 2009-01-12 Gonzalo Paniagua Javier <[email protected]>
* FtpWebRequest.cs: now deleting a file works when we're not in the
	root directory.


svn path=/trunk/mcs/; revision=123135
2009-01-12 22:02:18 +00:00
Gonzalo Paniagua Javier 9e7ecafa95 2008-11-13 Gonzalo Paniagua Javier <[email protected]>
* 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
2008-11-13 22:55:54 +00:00
Gonzalo Paniagua Javier 986dd1844a 2008-11-03 Gonzalo Paniagua Javier <[email protected]>
* 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
2008-11-04 03:08:10 +00:00
Gonzalo Paniagua Javier 0ddcf6a74d 2008-10-31 Gonzalo Paniagua Javier <[email protected]>
* 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
2008-11-01 04:01:27 +00:00
Miguel de Icaza 737ee8e35c 2007-12-12 Miguel de Icaza <[email protected]>
* 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
2007-12-12 05:24:52 +00:00
Miguel de Icaza 2fa3ce5f9b 2007-12-03 Miguel de Icaza <[email protected]>
* FtpWebRequest.cs: Applied patch from Jerome Haltom that fixes
	multi-line responses (after my fix).

	Closes #333978


svn path=/trunk/mcs/; revision=90540
2007-12-03 08:18:01 +00:00
Marek Safar e61dde083e Warnings cleanup
svn path=/trunk/mcs/; revision=89678
2007-11-15 14:14:49 +00:00
Miguel de Icaza 0556dc7ddb FtpWebRequest is always 2.0, remove unnecessary ifdefs
svn path=/trunk/mcs/; revision=88868
2007-11-05 14:48:36 +00:00
Miguel de Icaza 76cd5f7102 2007-11-04 Miguel de Icaza <[email protected]>
* FtpWebRequest.cs (GetResponseStatus): Fix this routine
	propertly, refactor, and make it follow Mono coding conventions.

svn path=/trunk/mcs/; revision=88820
2007-11-04 16:11:04 +00:00
Miguel de Icaza d42b709522 2007-10-30 Jerome Haltom ([email protected])
* FtpWebRequest.cs: adds support for ftp multiline results, fixes
	#333978

svn path=/trunk/mcs/; revision=88460
2007-10-30 14:51:40 +00:00
Gert Driesen a8b9d17527 * FtpWebRequest.cs: Added support for DELETE.
svn path=/trunk/mcs/; revision=87530
2007-10-15 18:47:32 +00:00
Dick Porter d4402975ad 2007-06-28 Chris Howie <[email protected]>
* ServicePoint.cs: Implemented BindIPEndPointDelegate.
	* FtpWebRequest.cs: Respect ServicePoint.BindIPEndPointDelegate.
	* WebConnection.cs: Respect ServicePoint.BindIPEndPointDelegate.

2007-06-28  Chris Howie  <[email protected]>

	* ServicePointTest.cs: Add some loose tests for
	ServicePoint.BindIPEndPointDelegate.


svn path=/trunk/mcs/; revision=83666
2007-08-08 13:14:21 +00:00
Dick Porter 6b41703ee1 2007-06-21 Dick Porter <[email protected]>
* AuthenticationManager.cs: 
	* FtpWebRequest.cs: 
	* Cookie.cs: 
	* ServicePoint.cs: 
	* WebClient.cs: 
	* Authorization.cs: 
	* FileWebRequest.cs: 
	* HttpWebRequest.cs: 
	* WebResponse.cs: 
	* ServicePointManager.cs: 
	* HttpWebResponse.cs: Throw NotImplementedException indirectly, to
	reduce noise in Moma reports.



svn path=/trunk/mcs/; revision=80484
2007-06-21 15:24:34 +00:00
Dick Porter fa277dafe1 2007-06-19 Dick Porter <[email protected]>
* AuthenticationManager.cs: 
	* IWebProxyScript.cs: 
	* Authorization.cs: 
	* Cookie.cs: 
	* CookieException.cs: 
	* CredentialCache.cs: 
	* FileWebRequest.cs: 
	* WebRequest.cs: 
	* FileWebResponse.cs: 
	* WebResponse.cs: 
	* FtpWebRequest.cs: 
	* HttpWebRequest.cs: 
	* DecompressionMethods.cs: 
	* HttpWebResponse.cs: 
	* ProtocolViolationException.cs: 
	* ServicePoint.cs: 
	* ServicePointManager.cs: 
	* WebClient.cs: 
	* WebException.cs: 
	* WebHeaderCollection.cs: 
	* WebProxy.cs: 
	* WebExceptionStatus.cs: 2.0 profile updates



svn path=/trunk/mcs/; revision=80152
2007-06-19 13:23:16 +00:00
Miguel de Icaza 47e90dd7a5 Fix the space problem for FTP requests
svn path=/trunk/mcs/; revision=73979
2007-03-09 01:35:48 +00:00
Miguel de Icaza 3a507fbe53 2007-01-22 Miguel de Icaza <[email protected]>
* HttpWebRequest.cs: Remove unused variable.

	* FtpWebRequest.cs: Remove unused variable.

svn path=/trunk/mcs/; revision=71484
2007-01-22 22:21:37 +00:00
Gert Driesen 8dd8383f61 * HttpWebRequest.jvm.cs: Fixed line endings.
* HttpWebResponse.jvm.cs: Same.
* WebException.cs: Same.
* FtpWebRequest.cs: Same.
* VMWHttpProvider.jvm.cs: Same.

svn path=/trunk/mcs/; revision=70199
2006-12-29 09:31:51 +00:00
David Elkind 22f54ecce3 * FtpAsyncResult.cs : FTP request is now working and covers about 100% of .NET API
* 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
2006-12-18 08:42:00 +00:00
Atsushi Eno 8ada1682cd 2006-10-30 Atsushi Enomoto <[email protected]>
* FtpWebRequest.cs : more build fixes.


svn path=/trunk/mcs/; revision=67166
2006-10-31 00:26:54 +00:00
Carlos Alberto Cortez bced98f073 * FtpWebRequest.cs: Remove WebExceptionStatus argument
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
2006-02-09 06:27:17 +00:00
Carlos Alberto Cortez 1dbcb72576 2006-02-08 Carlos Alberto Cortez <[email protected]>
* FtpWebRequest.cs: Add renaming support when using 
	WebRequestMethods.Ftp.Rename method.
	

svn path=/trunk/mcs/; revision=56693
2006-02-09 05:22:50 +00:00
Carlos Alberto Cortez 4ddfd405ee * FtpWebRequest.cs: Add supportedCommands array with the sorted
methods, to search using Array.BinarySearch. Remove CheckMethod.

2006-02-01  Carlos Alberto Cortez <[email protected]>


svn path=/trunk/mcs/; revision=56557
2006-02-04 02:40:20 +00:00
Carlos Alberto Cortez f636221ad7 2006-02-01 Carlos Alberto Cortez <[email protected]>
* FtpWebRequest.cs: Fixed some typos and small issues.
	

svn path=/trunk/mcs/; revision=56513
2006-02-03 10:04:14 +00:00
Carlos Alberto Cortez 2e3ef63ec0 * FtpRequestCreator.cs:
* FtpAsyncResult.cs:
	* FtpDataStream.cs:
	* FtpWebRequest.cs:
	* FtpWebResponse.cs: Initial implementation of FtpWebRequest (2.0)
	
2006-02-01  Carlos Alberto Cortez <[email protected]>


svn path=/trunk/mcs/; revision=56433
2006-02-02 01:59:28 +00:00