Commit Graph
36 Commits
Author SHA1 Message Date
Gert Driesen d1251bd902 * WebClient.cs: Do not add trailing CRLF in UploadValuesCore. Fixes
standalone test for bug #351049.

svn path=/trunk/mcs/; revision=92723
2008-01-12 09:52:20 +00:00
Miguel de Icaza 6162ce03bd 2007-12-27 Miguel de Icaza <[email protected]>
* WebClient.cs: We catch exceptions that happen on the helper
	async threads toa void terminating the application on errors, and
	also raise a variant of the OnXXXXCompleted methods that take an
	Exception argument.

	Note that this differs from the .NET implementation in that
	we actually raise a signal on error, and set the exception, and in
	their case no error is ever raised.

	We now call CompleteAsync in the OnXXXCompleted handlers to ensure
	that the WebClient can be reused immediately by the callback.

	This fixes #350621.

	This also should fix the bug report on IRC where someone
	complained that they could not "chain" invocations to XXXAsync
	methods from the OnXXXXCompleted handlers due to the WebClient
	refusing to work if there was an ongoing operation


svn path=/trunk/mcs/; revision=91959
2007-12-27 18:30:23 +00:00
Miguel de Icaza f926a3544e 2007-12-24 Miguel de Icaza <[email protected]>
* WebClient.cs: Do not validate method to be null, we do not do
	that in OpenWrite, the detection is done later on.  

	Fixes #350622

svn path=/trunk/mcs/; revision=91867
2007-12-24 19:55:08 +00:00
Miguel de Icaza 9b1df4c381 2007-12-16 Miguel de Icaza <[email protected]>
* WebClient.cs: Got the arguments in the wrong order, fix

svn path=/trunk/mcs/; revision=91371
2007-12-16 05:38:06 +00:00
Marek Habersack f3422a1f2b 2007-12-12 Marek Habersack <[email protected]>
* WebClient.cs: DownloadProgressChanged is available only in the
	2.0+ profiles

svn path=/trunk/mcs/; revision=91152
2007-12-12 13:15:12 +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
Gert Driesen 1ee31fadfe * WebClient.cs: Modified argument checks to match MS, and wrap
exceptions in a WebException. Fixes bug #343064.
* WebClient.cs: Added tests for argument checks.

svn path=/trunk/mcs/; revision=90581
2007-12-03 19:09:56 +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
Adar Wesley 831089227a 2007-05-16 Adar Wesley <[email protected]>
* System20.csproj: added classes to compilation set IOControlCode.cs,
	IPPacketInformation.cs

	* CookieCollection.cs: added missing method strongly typed CopyTo.

	* CredentialCache.cs: added missing methods Add, Remove, GetCredential

	* HttpWebRequest.jvm.cs: added missing ClientCertificates getter.

	* ServicePoint.cs: added missing method CloseConnectionGroup.

	* WebClient.cs: added missing methods OnDownloadProgressChanged,
	OnUploadProgressChanged, GetWebRequest, GetWebResponse

	* WebHeaderCollection.cs: added missing methods IsRestricted, Add,
	Remove, Set.

	* WebProxy.cs: added missing method GetObjectData.

	* Socket.jvm.cs: added missing methods EndDisconnect, IOControl,
	Send 2.0 overloads, Receive 2.0 overloads, ReceiveMessageFrom,
	BeginReceiveMessageFrom, EndReceiveMessageFrom, 
	EndAccept 2.0 overloads, BeginSend, EndSend, BeginReceive, 
	EndReceive, SendFile, BeginSendFile, EndSendFile, Disconnect,
	DuplicateAndClose

svn path=/trunk/mcs/; revision=77472
2007-05-16 12:03:13 +00:00
Miguel de Icaza 23b3264679 Fix for #81066 plus test
svn path=/trunk/mcs/; revision=73988
2007-03-09 06:08:25 +00:00
Marek Habersack a29c0ddb49 Fix for bug 81005
svn path=/trunk/mcs/; revision=73635
2007-03-02 14:17:10 +00:00
Martin Baulig 359bd48645 The new code correctly reports a CS0136 here.
svn path=/trunk/mcs/; revision=65451
2006-09-15 13:24:10 +00:00
Atsushi Eno cd5d2e868b 2006-04-04 Atsushi Enomoto <[email protected]>
* WebClient.cs : added a bunch of async method support.


svn path=/trunk/mcs/; revision=58993
2006-04-04 00:47:56 +00:00
Miguel de Icaza a5bd130af9 2006-03-11 Miguel de Icaza <[email protected]>
* Uri.cs: Pragma disable warning 612 (Obsolete methods are being
	used by us internally).

	Ponder: should we instead move our methods to use new versions of
	the Obsoleted ones?

2006-03-11  Miguel de Icaza  <[email protected]>

	* CodeNamespaceImportCollection.cs: It turns out that a lot of the
	errors flagged with "!" were just missing explicit interface
	implementations.  

	Implement.

2006-03-11  Miguel de Icaza  <[email protected]>

	* CodeDomConfigurationHandler.cs: Comment out unused methods. 

	* TempFileCollection.cs: Implement explicitly some interface
	methods to get rid of the "!" errors on CorCompare.

2006-03-11  Miguel de Icaza  <[email protected]>

	* Queue.cs: Flag as serializable.

	* LinkedList.cs (OnDeserialization): Fix signature. 

	* SortedList.cs: Implement explicitly a few methods that were
	flagged by corcompare. 

2006-03-11  Miguel de Icaza  <[email protected]>

	* IOrderedDictionary.cs: Flag GetEnumerator as a "new" method to
	avoid warning.

2006-03-11  Miguel de Icaza  <[email protected]>

	* ConfigurationSettings.cs (ChangeConfigurationSettings): Make
	internal to avoid warnings.  This routine is called from
	System.Web with MethodInfo.Invoke.

2006-03-11  Miguel de Icaza  <[email protected]>

	* DeflateStream.cs: Comment out DllImport that was not being
	used. 

2006-03-11  Miguel de Icaza  <[email protected]>

	* y

	* SerialPort.cs: Remove unused variable (writeBuffer). 

	* SerialPortStream.cs (Dispose): override, not new.

2006-03-11  Miguel de Icaza  <[email protected]>

	* WebClient.cs: Only expose the right methods to avoid warnings. 

	* FtpDataStream.cs (Dispose): Fix signature.

	* FtpWebResponse.cs: Comment out keepAlive field (unused, sounds
	like we are missing features here).

	* IPAddress.cs: Move m_HashCode property to the end, and set
	pragmas to disable warnings.

2006-03-11  Miguel de Icaza  <[email protected]>

	* MailAddress.cs: Comment out unused field to remove warning. 

2006-03-11  Miguel de Icaza  <[email protected]>

	* NetworkChange.cs: Use pragmas to eliminate warnings from events
	that we do not trigger yet.

	This is a candidate for using Aaron's NetworkManager code.  But
	would make us depend on d-bus.

	* NetworkInformationException.cs: Use error_code for ErrorCode,
	instead of NativeErrorCode.   Fixes warning. 

2006-03-11  Miguel de Icaza  <[email protected]>

	* AuthenticatedStream.cs: Fixed normative parameter names (yes, we
	need to do this everywhere one day).

	(Close): actually obey the "leaveInnerStreamOpen" setting from the
	constructor. 

2006-03-11  Miguel de Icaza  <[email protected]>

	* NetworkStream.cs (Dispose): Use the right signature depending on
	the profile being built.

2006-03-11  Miguel de Icaza  <[email protected]>

	* X509Chain.cs: Flagged member as internal to avoid unused warning.

	* X500DistinguishedName.cs: Comment out unused names and move
	temporary unused variables inside the comments that were removed 



svn path=/trunk/mcs/; revision=57836
2006-03-11 19:07:56 +00:00
Gonzalo Paniagua Javier 3c717f5efc 2006-01-26 Gonzalo Paniagua Javier <[email protected]>
* WebClient.cs: (2.0) UploadString() returns string, not void.


svn path=/trunk/mcs/; revision=56129
2006-01-27 00:18:43 +00:00
Atsushi Eno a7086ad597 2005-11-05 Atsushi Enomoto <[email protected]>
* WebClient: use POST for DownloadData(). Fixed bug #76631.


svn path=/trunk/mcs/; revision=52612
2005-11-05 20:22:01 +00:00
Atsushi Eno 63a0379360 2005-10-19 Atsushi Enomoto <[email protected]>
* WebClient.cs : added net_2_0 DownloadString() and DownloadData()
	  with HTTP method as well.


svn path=/trunk/mcs/; revision=51902
2005-10-19 06:34:44 +00:00
Atsushi Eno 13d260e679 2005-10-19 Atsushi Enomoto <[email protected]>
* WebClient.cs : added UploadString() and Encoding (net_2_0). Added
	  some new overloaded stuff that takes Uri instead of string address.


svn path=/trunk/mcs/; revision=51901
2005-10-19 06:21:29 +00:00
Gonzalo Paniagua Javier ce669ae08c style
svn path=/trunk/mcs/; revision=50825
2005-09-27 07:02:48 +00:00
Duncan Mak 24f5ef2c44 Add MIT license to System.dll
svn path=/trunk/mcs/; revision=30054
2004-06-21 18:02:11 +00:00
Nick Drochak b9ce91a104 2004-01-27 Nick Drochak <[email protected]>
* DigestClient.cs:
	* HttpWebRequest.cs:
	* IPv6Address.cs:
	* WebClient.cs:
	* WebConnection.cs:
	* WebConnectionStream.cs: Remove unused variables thus eliminating some
	build warnings.

svn path=/trunk/mcs/; revision=22538
2004-01-27 14:28:18 +00:00
Pedro Martínez Juliá 4b9bf9ec29 2003-10-17 Pedro Mart�nez Juli� <[email protected]>
* WebClient.cs: use Path.DirectorySeparator instead of "/" for
    windows compatibility. Add some checks for file paths like
    "C:/xxx/yyy/..." and like "/home/xxx/...".

svn path=/trunk/mcs/; revision=19127
2003-10-17 11:14:15 +00:00
Pedro Martínez Juliá 463bed0b0b 2003-10-16 Pedro Mart�nez Juli� <[email protected]>
* WebClient.cs: added a slash between directory and file names.

svn path=/trunk/mcs/; revision=19098
2003-10-16 00:59:32 +00:00
Pedro Martínez Juliá ee2617c815 2003-10-12 Pedro Mart�nez Juli� <[email protected]>
* WebClient.cs: refine reading of local files (like MS.NET).

svn path=/trunk/mcs/; revision=18912
2003-10-12 15:54:36 +00:00
Pedro Martínez Juliá 3797b802e3 2003-10-10 Pedro Mart�nez Juli� <[email protected]>
* Uri.cs: fixed a problem with some URIs like file://some_file.txt
    It used to return "/some_file.txt/" instead of "some_file.txt" in
    LocalPath. Fix handling of full path files and SMB addresses.

    * UriTest.cs: added some test for "file://one_file.txt". Uri used to
    fail with this URIs.

    * WebClient.cs: MS.NET works right when we try OpenRead("file.txt")
    but we didn't. Now, when Uri fails with an exception, it adds
    "file://" before the URI and tries again.

svn path=/trunk/mcs/; revision=18870
2003-10-10 23:38:41 +00:00
Gonzalo Paniagua Javier 8823e1fd4e 2003-07-01 Gonzalo Paniagua Javier <[email protected]>
* WebClient.cs: fixed bug #45651.

svn path=/trunk/mcs/; revision=15800
2003-07-01 00:16:05 +00:00
Gonzalo Paniagua Javier d526bd6474 2003-06-29 Gonzalo Paniagua Javier <[email protected]>
* WebClient.cs: Small fix by Sebastian <[email protected]>.

svn path=/trunk/mcs/; revision=15727
2003-06-29 18:26:52 +00:00
Gonzalo Paniagua Javier 435ec337a7 2003-06-11 Gonzalo Paniagua Javier <[email protected]>
* WebClient.cs: implemented UploadFile. Fixed SetupRequest to set the
	special headers *after* the others.

svn path=/trunk/mcs/; revision=15325
2003-06-11 20:48:43 +00:00
Gonzalo Paniagua Javier f8dbb61730 This compiled ok with mcs. Preparing bugreport.
svn path=/trunk/mcs/; revision=15181
2003-06-08 13:53:02 +00:00
Gonzalo Paniagua Javier ddf5ef623a 2003-06-08 Gonzalo Paniagua Javier <[email protected]>
* HttpWebRequest.cs: don't send "Expect: 100-continue" is the server
	is known not to respond to that.

	* ServicePoint.cs: added SendContinue property.

	* WebConnection.cs: only wait 2 seconds for a continue reply. If it
	timeouts, set SendContinue to false and proceeed sending data.

	* WebConnectionStream.cs: if 100-continue is not received and instead we
	get a 417 or anything else, don't send the data.

	* WebClient.cs: implemented all missing properties and methods except
	UploadFile.

svn path=/trunk/mcs/; revision=15180
2003-06-08 13:47:28 +00:00
Miguel de Icaza 7ab0c9dff7 2003-04-29 Miguel de Icaza <[email protected]>
* WebClient.cs (DownloadData): Close the underlyng stream.
	(DownloadFile): Use using, so the file gets closed.

svn path=/trunk/mcs/; revision=14128
2003-04-30 01:05:47 +00:00
Miguel de Icaza 6419036c57 2003-04-24 Miguel de Icaza <[email protected]>
* WebClient.cs (DownloadData): Instead of using a MemoryStream,
	keep track of all the small chunks in an ArrayList.  The
	MemoryStream had the property of reallocating itself, and the
	problem was that MemoryStream.GetBuffer would return the buffer
	(correctly), but not something of the right size.  So clients of
	DownloadData would get the extra unused bytes as part of the
	result.

	The solution would have been to make another copy at this point,
	instead, we only keep the small allocations around in the
	ArrayList, and we only do one large allocation at the end.

	* HttpWebResponse.cs: If there is a Content-Length header, pass
	this information to our HttpWebResponseStream, so it knows when to
	stop, instead of waiting for the stream to be shut down by the
	other end.

	* HttpWebRequest.cs: Only set the `delay-header-writing' mode on
	the underlying stream if the method will do a content transfer and
	no Content-Length was provided. If not (HEAD and GET or
	Content-Length provided), keep going.

svn path=/trunk/mcs/; revision=13986
2003-04-24 22:50:29 +00:00
Nick Drochak 91bb988c97 2003-02-17 Nick Drochak <[email protected]>
* WebClient.cs : Implemented Credentials property.

svn path=/trunk/mcs/; revision=11634
2003-02-17 09:14:19 +00:00
Atsushi Eno ccc7255252 2003-01-29 Atsushi Enomoto <[email protected]>
* WebClient.cs : hacked OpenRead, DownloadData and DownloadFile.

svn path=/trunk/mcs/; revision=10990
2003-01-28 16:33:04 +00:00
Lawrence Pit 11fdd62665 * WebClient.cs: stubbed
* WebProxy.cs: fixed bug

	* WebProxyTest.cs: added more ctor tests

svn path=/trunk/mcs/; revision=4806
2002-05-21 03:07:21 +00:00