Răsfoiți Sursa

In .:
2009-04-09 Sebastien Pouliot <[email protected]>

* System.Net.dll.sources: Remove some unneeded files for the
build. Add the SL2 specific enums, instead of using the existing
ones from System.dll. Include Socket_2_1.cs (from System) and use
the AssemblyInfo.cs for this assembly

In System.Net:
2009-04-09 Sebastien Pouliot <[email protected]>

* DnsEndPoint_2_1.cs: Fix header.
* HttpStatusCode_2_1.cs: New. SL2 (short) version of the enum
* HttpWebRequest_2_1.cs: Add missing members
* WebExceptionStatus_2_1.cs: New. SL2 (short) version of the enum
* WebHeaderCollection_2_1.cs: Implement S.C.IEnumerable


svn path=/trunk/mcs/; revision=131400

Sebastien Pouliot 17 ani în urmă
părinte
comite
85fbebbc99

+ 7 - 0
mcs/class/System.Net/ChangeLog

@@ -1,3 +1,10 @@
+2009-04-09  Sebastien Pouliot  <[email protected]> 
+
+	* System.Net.dll.sources: Remove some unneeded files for the
+	build. Add the SL2 specific enums, instead of using the existing
+	ones from System.dll. Include Socket_2_1.cs (from System) and use
+	the AssemblyInfo.cs for this assembly
+
 2009-04-09  Sebastien Pouliot  <[email protected]>
 
 	* System.Net.dll.sources: Remove classes that are not in the 

+ 8 - 28
mcs/class/System.Net/System.Net.dll.sources

@@ -1,25 +1,26 @@
 ../../build/common/Consts.cs
 ../../build/common/Locale.cs
 ../../build/common/MonoTODOAttribute.cs
-../corlib/System/ICloneable.cs
-../corlib/System.Collections/ArrayList.cs
-../corlib/System.Collections/Comparer.cs
-../corlib/System.Collections/Queue.cs
 DummySystemNet.cs
+Assembly/AssemblyInfo.cs
 System.Net/DnsEndPoint_2_1.cs
 System.Net/HttpWebRequest_2_1.cs
 System.Net/HttpWebResponse_2_1.cs
+System.Net/HttpStatusCode_2_1.cs
+System.Net/WebExceptionStatus_2_1.cs
 System.Net/WebHeaderCollection_2_1.cs
 System.Net/WebClient_2_1.cs
 System.Net/WebRequest_2_1.cs
 System.Net/WebResponse_2_1.cs
 System.Net/WriteStreamClosedEventArgs_2_1.cs
 System.Net/WriteStreamClosedEventHandler_2_1.cs
+System.Net.Sockets/AddressFamily_2_1.cs
 System.Net.Sockets/SocketException_2_1.cs
-../System/Assembly/AssemblyInfo.cs
+System.Net.Sockets/ProtocolType_2_1.cs
+System.Net.Sockets/SocketAsyncOperation_2_1.cs
+System.Net.Sockets/SocketType_2_1.cs
 ../System/System.Net/AuthenticationSchemes.cs
 ../System/System.Net/AuthenticationSchemeSelector.cs
-../System/System.Net/Authorization.cs
 ../System/System.Net.Cache/HttpCacheAgeControl.cs
 ../System/System.Net.Cache/HttpRequestCacheLevel.cs
 ../System/System.Net.Cache/HttpRequestCachePolicy.cs
@@ -30,25 +31,16 @@ System.Net.Sockets/SocketException_2_1.cs
 ../System/System.Net/CookieContainer.cs
 ../System/System.Net/Cookie.cs
 ../System/System.Net/CookieException.cs
-../System/System.Net/CredentialCache.cs
-../System/System.Net/DecompressionMethods.cs
 ../System/System.Net/Dns.cs
 ../System/System.Net/EndPoint.cs
-../System/System.Net/EndPointListener.cs
-../System/System.Net/EndPointManager.cs
 ../System/System.Net/HttpConnection.cs
 ../System/System.Net/HttpContinueDelegate.cs
 ../System/System.Net/HttpRequestCreator.cs
 ../System/System.Net/HttpRequestHeader.cs
 ../System/System.Net/HttpResponseHeader.cs
-../System/System.Net/HttpStatusCode.cs
 ../System/System.Net/HttpStreamAsyncResult.cs
 ../System/System.Net/HttpUtility.cs
 ../System/System.Net/HttpVersion.cs
-../System/System.Net/IAuthenticationModule.cs
-../System/System.Net/ICredentialLookup.cs
-../System/System.Net/ICredentialPolicy.cs
-../System/System.Net/ICredentialsByHost.cs
 ../System/System.Net/IPAddress.cs
 ../System/System.Net/IPEndPoint.cs
 ../System/System.Net/IPHostEntry.cs
@@ -64,7 +56,6 @@ System.Net.Sockets/SocketException_2_1.cs
 ../System/System.Net/MonoHttpDate.cs
 ../System/System.Net/NetConfig.cs
 ../System/System.Net/NetworkAccess.cs
-../System/System.Net/NetworkCredential.cs
 ../System/System.Net.NetworkInformation/DuplicateAddressDetectionState.cs
 ../System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs
 ../System/System.Net.NetworkInformation/GatewayIPAddressInformation.cs
@@ -104,31 +95,26 @@ System.Net.Sockets/SocketException_2_1.cs
 ../System/System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs
 ../System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs
 ../System/System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs
-../System/System.Net/NtlmClient.cs
 ../System/System.Net/ProtocolViolationException.cs
 ../System/System.Net/RequestStream.cs
 ../System/System.Net/ResponseStream.cs
 ../System/System.Net.Security/AuthenticatedStream.cs
 ../System/System.Net.Security/AuthenticationLevel.cs
 ../System/System.Net.Security/LocalCertificateSelectionCallback.cs
-../System/System.Net.Security/NegotiateStream.cs
 ../System/System.Net.Security/ProtectionLevel.cs
 ../System/System.Net/SecurityProtocolType.cs
 ../System/System.Net.Security/RemoteCertificateValidationCallback.cs
 ../System/System.Net.Security/SslStream.cs
 ../System/System.Net.Security/SslPolicyErrors.cs
 ../System/System.Net/SocketAddress.cs
-../System/System.Net.Sockets/AddressFamily.cs
 ../System/System.Net.Sockets/IOControlCode.cs
 ../System/System.Net.Sockets/IPv6MulticastOption.cs
 ../System/System.Net.Sockets/IPPacketInformation.cs
 ../System/System.Net.Sockets/LingerOption.cs
 ../System/System.Net.Sockets/MulticastOption.cs
-../System/System.Net.Sockets/NetworkStream.cs
 ../System/System.Net.Sockets/ProtocolFamily.cs
-../System/System.Net.Sockets/ProtocolType.cs
 ../System/System.Net.Sockets/SelectMode.cs
-../System/System.Net.Sockets/Socket.cs
+../System/System.Net.Sockets/Socket_2_1.cs
 ../System/System.Net.Sockets/SocketError.cs
 ../System/System.Net.Sockets/SocketFlags.cs
 ../System/System.Net.Sockets/SocketInformation.cs
@@ -136,18 +122,12 @@ System.Net.Sockets/SocketException_2_1.cs
 ../System/System.Net.Sockets/SocketOptionLevel.cs
 ../System/System.Net.Sockets/SocketOptionName.cs
 ../System/System.Net.Sockets/SocketShutdown.cs
-../System/System.Net.Sockets/SocketType.cs
-../System/System.Net.Sockets/TcpClient.cs
-../System/System.Net.Sockets/TcpListener.cs
 ../System/System.Net.Sockets/TransmitFileOptions.cs
-../System/System.Net.Sockets/UdpClient.cs
 ../System/System.Net.Sockets/SendPacketsElement.cs
 ../System/System.Net.Sockets/SocketAsyncEventArgs.cs
-../System/System.Net.Sockets/SocketAsyncOperation.cs
 ../System/System.Net/TransportType.cs
 ../System/System.Net/WebAsyncResult.cs
 ../System/System.Net/WebException.cs
-../System/System.Net/WebExceptionStatus.cs
 ../System/System.Net/WebRequestMethods.cs
 ../System/System.Net/UploadDataCompletedEventArgs.cs
 ../System/System.Net/UploadFileCompletedEventArgs.cs

+ 8 - 0
mcs/class/System.Net/System.Net/ChangeLog

@@ -1,3 +1,11 @@
+2009-04-09  Sebastien Pouliot  <[email protected]>
+
+	* DnsEndPoint_2_1.cs: Fix header.
+	* HttpStatusCode_2_1.cs: New. SL2 (short) version of the enum
+	* HttpWebRequest_2_1.cs: Add missing members
+	* WebExceptionStatus_2_1.cs: New. SL2 (short) version of the enum
+	* WebHeaderCollection_2_1.cs: Implement S.C.IEnumerable
+
 2009-03-11  Rolf Bjarne Kvinge  <[email protected]>
 
 	* WebClient_2_1.cs: OnOpenReadCompleted and OnDownloadStringCompleted:

+ 1 - 1
mcs/class/System.Net/System.Net/DnsEndPoint_2_1.cs

@@ -1,5 +1,5 @@
 //
-// System.Net.HttpWebRequest (for 2.1 profile)
+// System.Net.DnsEndPoint (for 2.1 profile)
 //
 // Authors:
 //	Stephane Delcroix  <[email protected]>

+ 33 - 0
mcs/class/System.Net/System.Net/HttpStatusCode_2_1.cs

@@ -0,0 +1,33 @@
+// HttpStatusCode.cs
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_1
+
+namespace System.Net {
+	public enum HttpStatusCode {
+		OK = 200,
+		NotFound = 404,
+	}
+}
+
+#endif
+

+ 81 - 3
mcs/class/System.Net/System.Net/HttpWebRequest_2_1.cs

@@ -5,7 +5,7 @@
 //	Atsushi Enomoto  <[email protected]>
 //  Jb Evain  <[email protected]>
 //
-// (c) 2007 Novell, Inc. (http://www.novell.com)
+// Copyright (C) 2007, 2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -31,18 +31,96 @@
 
 #if NET_2_1
 
-using System;
+using System.IO;
 
 namespace System.Net { 
 
+	// note: the NotImplementedException are needed to match MS implementation
+
 	public abstract class HttpWebRequest : WebRequest {
 
-		public abstract bool HaveResponse { get; }
+		private string accept;
+		private string content_type;
+		private WebHeaderCollection headers;
+
+		protected HttpWebRequest ()
+		{
+		}
+
+		public string Accept {
+			get { return accept; }
+			set {
+				if (String.IsNullOrEmpty (value))
+					accept = null;
+				else
+					accept = value;
+			}
+		}
+
 		public virtual bool AllowReadStreamBuffering {
 			get { throw new NotImplementedException (); }
 			set { throw new NotImplementedException (); }
 		}
+
+		public override string ContentType {
+			get { return content_type; }
+			set {
+				if (String.IsNullOrEmpty (value))
+					content_type = null;
+				else
+					content_type = value;
+			}
+		}
+
+		public virtual bool HaveResponse {
+			get { throw new NotImplementedException (); }
+		}
+
+		public override WebHeaderCollection Headers {
+			get { return headers; }
+			set {
+				if (value == null)
+					throw new NullReferenceException ();
+				headers = value;
+			}
+		}
+
+		public override string Method {
+			get { throw new NotImplementedException (); }
+			set { throw new NotImplementedException (); }
+		}
+
+		public override Uri RequestUri {
+			get { throw new NotImplementedException (); }
+		}
+
+
+		public override void Abort ()
+		{
+			throw new NotImplementedException ();
+		}
+
+		public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public override Stream EndGetRequestStream (IAsyncResult asyncResult)
+		{
+			throw new NotImplementedException ();
+		}
+
+		public override WebResponse EndGetResponse (IAsyncResult asyncResult)
+		{
+			throw new NotImplementedException ();
+		}
 	}
 }
 
 #endif
+

+ 45 - 0
mcs/class/System.Net/System.Net/WebExceptionStatus_2_1.cs

@@ -0,0 +1,45 @@
+// System.Net.WebExceptionStatus.cs
+//
+// Author:
+//   Andreas Nahr ([email protected])
+//   originally autogenerated by Sergey Chaban ([email protected])
+//
+// (C) 2001 Ximian, Inc.  http://www.ximian.com
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_1
+
+namespace System.Net {
+	public enum WebExceptionStatus {
+		Success = 0,
+		ConnectFailure = 2,
+		SendFailure = 4,
+		RequestCanceled = 6,
+		Pending = 13,
+		UnknownError = 16,
+		MessageLengthLimitExceeded = 17,
+	}
+}
+
+#endif
+

+ 7 - 1
mcs/class/System.Net/System.Net/WebHeaderCollection_2_1.cs

@@ -31,11 +31,12 @@
 #if NET_2_1
 
 using System;
+using System.Collections;
 using System.Collections.Generic;
 
 namespace System.Net {
 
-	public class WebHeaderCollection {
+	public class WebHeaderCollection : IEnumerable {
 
 		Dictionary<string, string> headers = new Dictionary<string, string> ();
 
@@ -71,6 +72,11 @@ namespace System.Net {
 			set { this [HttpRequestHeaderToString (header)] = value; }
 		}
 
+		IEnumerator IEnumerable.GetEnumerator ()
+		{
+			return headers.GetEnumerator ();
+		}
+
 		static string HttpResponseHeaderToString (HttpResponseHeader header)
 		{
 			switch (header) {