Commit Graph
398 Commits
Author SHA1 Message Date
Gert Driesen b26da0a865 * IPAddress.cs (Parse): Changed argument name to match MS.
(TryParse): Changed argument name to match MS.
(ParseIPV4): Only treat zero-length or " " address as empty on 1.0
profile. On 2.0 profile, only ignore characters after blank if last
part is valid hex string.
* IPv6Address.cs: Removed extra spaces and tabs.
* IPAddressTest.cs: Remove use of deprecated Assertion. Improved
existing tests.

svn path=/trunk/mcs/; revision=94052
2008-01-27 15:20:02 +00:00
Daniel Nauck 71883e528e 2008-01-26 Daniel Nauck <[email protected]>
* HttpWebRequest.cs: fixed typo. Use the actual uri for correct
	cookie header informations and not the originally one.


svn path=/trunk/mcs/; revision=94023
2008-01-26 21:14:20 +00:00
Daniel Nauck 65eb7e9ac1 2008-01-26 Daniel Nauck <[email protected]>
* Cookie.cs: set Version to '1' if Port is set,
	don't include path and domain informations when version is 0,
	match ToString () output with .NET 2.0,
	fixes bug #316017

	* CookieTest.cs: enabled ToString () test,
	added Version property test


svn path=/trunk/mcs/; revision=94013
2008-01-26 19:05:46 +00:00
Atsushi Eno 8be14ccb42 2008-01-15 Atsushi Enomoto <[email protected]>
* MonoHttpDate.cs : Parse() should return Local time. Fixed bug
	  #353495.

	* HttpWebRequestTest.cs : added test for bug #353495.


svn path=/trunk/mcs/; revision=92931
2008-01-15 10:07:48 +00:00
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
Sebastien Pouliot daa75af92e 2008-01-07 Sebastien Pouliot <[email protected]>
* CredentialCache.cs: Gendarme's AvoidToStringOnStringsRule in
	CredentialCacheKey constructor. UseStringEmptyRule on CredentialCache
	static ctor (3 times).


svn path=/trunk/mcs/; revision=92422
2008-01-07 23:23:39 +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
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 Habersack fb23c6fb46 2007-11-16 Marek Habersack <[email protected]>
* HttpWebRequest.cs: when folding a request into a GET one, set
	content length to 0 and kill the buffers. Fixes bug #327314. Patch
	from Geoff Norton <[email protected]>, thanks!

svn path=/trunk/mcs/; revision=89790
2007-11-16 20:31:22 +00:00
Atsushi Eno 526b9e66b9 2007-11-13 Atsushi Enomoto <[email protected]>
* WebRequest.cs : added missing ImpersonationLevel (NIE).
	* SecurityProtocolType.cs : not [Serializable] in 2.0.
	* ServicePoint.cs : no GetHashCode() in 2.0.
	* WebRequestMethods.cs : fixed wrong STOU.
	* FileWebResponse.cs : no Dispose(true) in 2.0 API.


svn path=/trunk/mcs/; revision=89537
2007-11-13 10:06:27 +00:00
Jb Evain fe90b6b00c 2007-11-08 Jb Evain <[email protected]>
* WebHeaderCollection_2_1.cs: add a custom WebHeaderCollection
	for the 2.1 profile.


svn path=/trunk/mcs/; revision=89250
2007-11-08 20:51:23 +00:00
Geoff Norton e5c305098e 2007-11-07 Geoff Norton <[email protected]>
* ListenerAsyncResult.cs: Only send the 401 header if our authentication
        type is Basic or Negotiate (which we default to basic) because that is
        all we support.  Set the WWW-Authenticate header when we return a 401
        result.  Send the correct state object in the async result.


svn path=/trunk/mcs/; revision=89174
2007-11-07 23:20:26 +00:00
Geoff Norton 61adde104b 2007-11-06 Geoff Norton <[email protected]>
* ListenerAsyncResult.cs: If the HttpListener has an authentication
        scheme, the user should be presented with a 401 without calling the
        callback.


svn path=/trunk/mcs/; revision=88981
2007-11-06 14:37:51 +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
Miguel de Icaza 07eda2a63f 2007-10-27 Miguel de Icaza <[email protected]>
* HttpListener.cs: Remove more trigger-happy disposed=true from
	the code;   We should only dispose when the Dispose method is
	actually called.   Not before.  

	Fixes #337371

svn path=/trunk/mcs/; revision=88323
2007-10-27 17:50:28 +00:00
Miguel de Icaza 58228927a3 2007-10-27 Miguel de Icaza <[email protected]>
*  HttpListener.cs (Close): Closing does not mean dispose the
	object.   This allows Start/Stop/Start to be called as many times
	as desired.

	Fixes #337368

svn path=/trunk/mcs/; revision=88322
2007-10-27 17:44:16 +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
Gert Driesen 397ba132a0 Remove commented code.
svn path=/trunk/mcs/; revision=87518
2007-10-15 15:48:09 +00:00
Gert Driesen b97ac2ba11 * WebRequestTest.cs: Fixed test for serialization ctor to match
1.0 profile change. Added trivial tests to argument null checks.
Added test for DefaultWebProxy. Fixed line endings.
* WebRequest.cs: Changed serialization ctor to throw NIE on 1.0
profile. Cache default proxy, but still allow it to be explicitly set 
to null.

svn path=/trunk/mcs/; revision=87517
2007-10-15 15:46:36 +00:00
Gonzalo Paniagua Javier 83729f4d65 2007-10-14 Gonzalo Paniagua Javier <[email protected]>
* WebRequest.cs: DefaultWebProxy allows a null value. Fixes bug #323668.


svn path=/trunk/mcs/; revision=87455
2007-10-14 06:19:30 +00:00
Gert Driesen e722420bd3 * HttpListenerRequest.cs: Do not store 'method' in upper case, but
instead use case-insensitive comparison.
* HttpListenerRequestTest.cs: Added test for HttpMethod.

svn path=/trunk/mcs/; revision=86673
2007-09-30 12:33:06 +00:00
Gert Driesen affbed9b01 * HttpListenerRequestTest.cs: Added test for HasEntityBody.
* HttpListener2Test.cs: Removed CWL.
* HttpListenerRequest.cs: Removed dead code. USe String.Length to
check for zero-length string. Use instance field for is_chunked, and
also set it for GET/HEAD/DELETE. Fixed HasEntityBody to return true
when Content-Length > 0, or Transfer-Encoding is chunked.
* System_test.dll.sources: Added HttpListenerRequestTest.cs.

svn path=/trunk/mcs/; revision=86666
2007-09-30 09:09:22 +00:00
Marek Habersack ed7f44ca0b 2007-09-28 Marek Habersack <[email protected]>
* HttpListenerRequest.cs: HasEntityBody should return false when method is GET/HEAD,
	content_length is less than or equal to zero or the request is
	chunked. Fixes bug #325296

svn path=/trunk/mcs/; revision=86555
2007-09-28 08:48:51 +00:00
Marek Habersack c0678f851f 2007-09-28 Marek Habersack <[email protected]>
* HttpListenerRequest.cs: make sure 'method' is always stored in
	upper case.
	The DELETE method must not error out on missing Content-Length
	header (this is the behavior of the MS.NET version of the
	class). Fixes bug #323215.

svn path=/trunk/mcs/; revision=86552
2007-09-28 07:42:31 +00:00
Atsushi Eno b21b41fb95 2007-08-29 Atsushi Enomoto <[email protected]>
* IPAddress.cs, IPv6Address.cs : (ToString) output ScopeId.

	* IPAddressTest.cs : added an address with scope id to parse/format
	  test.


svn path=/trunk/mcs/; revision=85016
2007-08-29 18:00:42 +00:00
Atsushi Eno b572fe6faa 2007-08-09 Atsushi Enomoto <[email protected]>
* HttpWebRequest_2_1.cs, HttpWebResponse_2_1.cs :
	  added new sources for those classes for 2.1 (in 2.1 they are
	  almost abstract, while in 2.0 they are concrete).
	* HttpRequestCreator.cs, ServicePoint.cs :
	  #ifdef 2.0 dependencies out.

	* net_2_1_System.dll.sources :
	  Replaced HttpWebRequest and HttpWebResponse with those for 2.1,
	  and removed related 2.0-only types.


svn path=/trunk/mcs/; revision=83773
2007-08-09 16:57:36 +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
Jb Evain 7d74c61c3a 2007-08-08 Jb Evain <[email protected]>
* HttpWebRequest.cs: .ctor(Uri) is public in 2.1.

svn path=/trunk/mcs/; revision=83635
2007-08-08 06:48:13 +00:00
Jb Evain 43af9c8328 2007-08-03 Jb Evain <[email protected]>
* Dns.cs: remove async methods for the 2.1 profile.

svn path=/trunk/mcs/; revision=83448
2007-08-03 20:46:43 +00:00
Rodrigo Kumpera bc6832357d 2007-07-17 Rodrigo Kumpera <[email protected]>
* HttpListenerRequest.cs: Support for Cookie decoding.
	* HttpListenerResponse.cs: Support for encoding cookies on the response sent to the client
	* Cookie.cs: new internal method to encode the Cookie in a proper form to sent to clients


svn path=/trunk/mcs/; revision=82153
2007-07-18 00:08:03 +00:00
Gonzalo Paniagua Javier 516285ad2f 2007-07-14 Gonzalo Paniagua Javier <[email protected]>
* WebConnectionStream.cs: implement the CanTimeout for 2.0. Fixes
	bug #81504.


svn path=/trunk/mcs/; revision=81997
2007-07-14 23:04:17 +00:00
Geoff Norton afb45d0489 2007-07-12 Geoff Norton <[email protected]>
* HttpListenerContext.cs: 
    * HttpListener.cs: Handle HttpListener AuthenticationSchemes
    Only Basic authentication is included for now.


svn path=/trunk/mcs/; revision=81889
2007-07-12 18:04:35 +00:00
Gert Driesen 9d17307d3b * NetworkAccess.cs: Only mark as flags enum on 2.0.
svn path=/trunk/mcs/; revision=81105
2007-06-30 13:37:26 +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
Atsushi Eno 840345be5b 2007-06-20 Atsushi Enomoto <[email protected]>
* ServicePointManager.cs : (bootstrap) build fix.


svn path=/trunk/mcs/; revision=80277
2007-06-20 03:00:37 +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
Gert Driesen 049dd55113 * WebConnectionStream.cs: On read timeout, throw WebException with
status Timeout instead of IOException.

svn path=/trunk/mcs/; revision=77633
2007-05-18 12:24:36 +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
Marek Habersack 1b87ef0104 2007-05-15 Marek Habersack <[email protected]>
* HttpWebRequest.cs: fold all methods into GET for
	redirect/moves. Fixes bug #81624


svn path=/trunk/mcs/; revision=77392
2007-05-15 06:48:11 +00:00
Miguel de Icaza 29fc1a6f37 2007-05-07 Miguel de Icaza <[email protected]>
Missing second part of the patch.
	

svn path=/trunk/mcs/; revision=76879
2007-05-08 00:29:01 +00:00
Miguel de Icaza 98fe081726 2007-05-07 Miguel de Icaza <[email protected]>
* WebHeaderCollection.cs: To be compatible with older versions of
	Mono that might have serialized this in a different format, catch
	the potential exception, and try the old name.

	This should become a practice whenever we fix serialization in the
	future. 

	This is for #81467

svn path=/trunk/mcs/; revision=76877
2007-05-07 23:11:54 +00:00
Marek Habersack 2670792b27 2007-04-23 Marek Habersack <[email protected]>
* EndPointListener.cs: relax prefix matching to succeed in cases
	when the prefix ends with / and the request path does not. Fixes
	bug #80091.


svn path=/trunk/mcs/; revision=76102
2007-04-23 10:56:00 +00:00
Marek Habersack da4429171a 2007-04-23 Marek Habersack <[email protected]>
* CookieContainerTest.cs: the GetCookies test works now.

2007-04-23  Marek Habersack  <[email protected]>

	* CookieContainer.cs: Sort the collection by the path relevance before returning from
	the GetCookies method. Fixes bug #81421.

svn path=/trunk/mcs/; revision=76101
2007-04-23 09:49:08 +00:00
Marek Habersack 6bbdd1a526 2007-04-23 Marek Habersack <[email protected]>
* Cookie.cs: do not return "/" for Path if it wasn't set
	explicitly.

	* CookieContainer.cs: set cookie path only if its version is
	"Netscape" and is null or empty. Fixes #81420.


svn path=/trunk/mcs/; revision=76095
2007-04-23 07:50:23 +00:00