//
// Author:
// Miguel de Icaza (miguel@ximian.com)
+// Lawrence Pit (loz@cable.a2000.nl)
//
// (C) Ximian, Inc. http://www.ximian.com
//
public class Authorization {
string token;
bool complete;
+ string connectionGroupId;
+ string [] protectionRealm;
- public Authorization (string token)
+ public Authorization (string token) : this (token, true)
{
- this.complete = true;
- this.token = token;
}
- public Authorization (string token, bool complete)
+ public Authorization (string token, bool complete)
+ : this (token, complete, null)
+ {
+ }
+
+ public Authorization (string token, bool complete, string connectionGroupId)
{
- this.complete = complete;
this.token = token;
+ this.complete = complete;
+ this.connectionGroupId = connectionGroupId;
+ }
+
+ public string Message {
+ get { return token; }
}
public bool Complete {
- get {
- return complete;
- }
+ get { return complete; }
}
+ public string ConnectionGroupId {
+ get { return connectionGroupId; }
+ }
+ public string[] ProtectionRealm {
+ get { return protectionRealm; }
+ set { protectionRealm = value; }
+ }
}
}
+2002-05-06 Lawrence Pit <loz@cable.a2000.nl>
+
+ * WebRequest.cs: added
+ * WebResponse.cs: implemented
+ * WebException.cs: implemented
+ * WebHeaderCollection.cs: added
+ * HttpVersion.cs: implemented
+ * HttpContinueDelegate.cs: added
+ * IWebProxy.cs: added
+ * IWebRequestCreate.cs: added
+ * ICertificatePolicy.cs: added
+ * ServicePoint.cs: stubbed
+ * ServicePointManager.cs: stubbed
+ * CookieContainer.cs: added
+ * Authorization.cs: implemented
+
2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
* CredentialCache.cs: implemented
--- /dev/null
+//\r
+// System.Net.CookieContainer\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System;\r
+using System.Collections;\r
+using System.Runtime.Serialization;\r
+\r
+namespace System.Net \r
+{\r
+ [Serializable]\r
+ public class CookieContainer\r
+ { \r
+ private int count;\r
+ private int capacity;\r
+ private int perDomainCapacity;\r
+ private int maxCookieSize;\r
+ \r
+ // ctors\r
+ public CookieContainer () : this (DefaultCookieLimit) \r
+ { \r
+ } \r
+ \r
+ public CookieContainer (int capacity) : \r
+ this (capacity, DefaultPerDomainCookieLimit, DefaultCookieLengthLimit) \r
+ { \r
+ }\r
+ \r
+ public CookieContainer (int capacity, int perDomainCapacity, int maxCookieSize)\r
+ {\r
+ this.capacity = capacity;\r
+ this.perDomainCapacity = perDomainCapacity;\r
+ this.maxCookieSize = maxCookieSize;\r
+ this.count = 0;\r
+ }\r
+\r
+ // fields \r
+ \r
+ public const int DefaultCookieLengthLimit = 4096;\r
+ public const int DefaultCookieLimit = 300;\r
+ public const int DefaultPerDomainCookieLimit = 20;\r
+ \r
+ // properties\r
+ \r
+ public int Count { \r
+ get { return count; }\r
+ }\r
+ \r
+ public int Capacity {\r
+ get { return capacity; }\r
+ set { \r
+ if ((value <= 0) ||\r
+ (value < perDomainCapacity && perDomainCapacity != Int32.MaxValue))\r
+ throw new ArgumentOutOfRangeException ("value");\r
+ if (value < maxCookieSize)\r
+ maxCookieSize = value;\r
+ capacity = value; \r
+ }\r
+ }\r
+ \r
+ public int MaxCookieSize {\r
+ get { return maxCookieSize; }\r
+ set {\r
+ if (value <= 0)\r
+ throw new ArgumentOutOfRangeException ("value"); \r
+ maxCookieSize = value;\r
+ }\r
+ }\r
+ \r
+ public int PerDomainCapacity {\r
+ get { return perDomainCapacity; }\r
+ set {\r
+ if ((value <= 0) ||\r
+ (value > DefaultCookieLimit && value != Int32.MaxValue))\r
+ throw new ArgumentOutOfRangeException ("value"); \r
+ if (value < perDomainCapacity)\r
+ perDomainCapacity = value;\r
+ perDomainCapacity = value;\r
+ }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public void Add (Cookie cookie) \r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public void Add (CookieCollection cookies)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public void Add (Uri uri, Cookie cookie)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public void Add (Uri uri, CookieCollection cookies)\r
+ {\r
+ throw new NotImplementedException ();\r
+ } \r
+\r
+ [MonoTODO]\r
+ public string GetCookieHeader (Uri uri)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public CookieCollection GetCookies (Uri uri)\r
+ {\r
+ throw new NotImplementedException (); \r
+ }\r
+\r
+ [MonoTODO]\r
+ public void SetCookies (Uri uri, string cookieHeader)\r
+ {\r
+ throw new NotImplementedException (); \r
+ }\r
+\r
+ } // CookieContainer\r
+\r
+} // System.Net\r
+\r
--- /dev/null
+//\r
+// System.Net.HttpContinueDelegate.cs\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+namespace System.Net\r
+{\r
+ public delegate void HttpContinueDelegate (\r
+ int StatusCode,\r
+ WebHeaderCollection httpHeaders);\r
+}\r
--- /dev/null
+//\r
+// System.Net.HttpVersion.cs\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System;\r
+\r
+namespace System.Net {\r
+\r
+ // <remarks>\r
+ // </remarks>\r
+ public class HttpVersion {\r
+ \r
+ public static readonly Version Version10 = new Version (1, 0);\r
+ public static readonly Version Version11 = new Version (1, 1);\r
+ \r
+ // pretty useless..\r
+ public HttpVersion () {}\r
+ }\r
+}\r
--- /dev/null
+//
+// System.Net.ICertificatePolicy.cs
+//
+// Author:
+// Lawrence Pit (loz@cable.a2000.nl)
+//
+
+using System.Security.Cryptography.X509Certificates;
+
+namespace System.Net {
+
+ // <remarks>
+ // </remarks>
+ public interface ICertificatePolicy {
+ bool CheckValidationResult (
+ ServicePoint srvPoint,
+ X509Certificate certificate,
+ WebRequest request,
+ int certificateProblem
+ );
+ }
+}
--- /dev/null
+//
+// System.Net.IWebProxy.cs
+//
+// Author:
+// Lawrence Pit (loz@cable.a2000.nl)
+//
+
+using System;
+
+namespace System.Net {
+
+ // <remarks>
+ // </remarks>
+ public interface IWebProxy {
+ ICredentials Credentials {
+ get;
+ set;
+ }
+
+ Uri GetProxy (Uri destination);
+
+ bool IsBypassed (Uri host);
+ }
+}
--- /dev/null
+//
+// System.Net.IWebRequestCreate.cs
+//
+// Author:
+// Lawrence Pit (loz@cable.a2000.nl)
+//
+
+namespace System.Net {
+
+ // <remarks>
+ // </remarks>
+ public interface IWebRequestCreate {
+ WebRequest Create (Uri uri);
+ }
+}
--- /dev/null
+//\r
+// System.Net.ServicePoint\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System;\r
+using System.Security.Cryptography.X509Certificates;\r
+\r
+namespace System.Net \r
+{\r
+ public class ServicePoint\r
+ {\r
+ private Uri uri;\r
+ private int connectionLimit;\r
+ private int maxIdleTime;\r
+ \r
+ // Constructors\r
+ internal ServicePoint (Uri uri, int connectionLimit, int maxIdleTime)\r
+ {\r
+ this.uri = uri;\r
+ this.connectionLimit = connectionLimit;\r
+ this.maxIdleTime = maxIdleTime;\r
+ }\r
+ \r
+ \r
+ // Properties\r
+ \r
+ public Uri Address {\r
+ get { return this.uri; }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public X509Certificate Certificate {\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public X509Certificate ClientCertificate {\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public int ConnectionLimit {\r
+ get { return connectionLimit; }\r
+ set {\r
+ if (value <= 0)\r
+ throw new ArgumentOutOfRangeException ();\r
+ connectionLimit = value;\r
+ }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public string ConnectionName {\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+\r
+ [MonoTODO]\r
+ public int CurrentConnections {\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+\r
+ [MonoTODO] \r
+ public DateTime IdleSince {\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+\r
+ [MonoTODO]\r
+ public int MaxIdleTime {\r
+ get { return maxIdleTime; }\r
+ set { this.maxIdleTime = value; }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public virtual Version ProtocolVersion {\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public bool SupportsPipelining {\r
+ get { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ // Methods\r
+ \r
+ [MonoTODO]\r
+ public override int GetHashCode() \r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+//\r
+// System.Net.ServicePointManager\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System;\r
+using System.Security.Cryptography.X509Certificates;\r
+\r
+namespace System.Net \r
+{\r
+ public class ServicePointManager\r
+ {\r
+ \r
+ // Fields\r
+ \r
+ public const int DefaultNonPersistentConnectionLimit = 4;\r
+ public const int DefaultPersistentConnectionLimit = 2;\r
+ \r
+ // Constructors\r
+ private ServicePointManager ()\r
+ {\r
+ } \r
+ \r
+ // Properties\r
+ \r
+ [MonoTODO]\r
+ public static ICertificatePolicy CertificatePolicy {\r
+ get { throw new NotImplementedException (); }\r
+ set { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public static int DefaultConnectionLimit {\r
+ get { throw new NotImplementedException (); }\r
+ set { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public static int MaxServicePointIdleTime {\r
+ get { throw new NotImplementedException (); }\r
+ set { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public static int MaxServicePoints {\r
+ get { throw new NotImplementedException (); }\r
+ set { throw new NotImplementedException (); }\r
+ }\r
+ \r
+ // Methods\r
+ \r
+ [MonoTODO]\r
+ public static ServicePoint FindServicePoint (Uri address) \r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public static ServicePoint FindServicePoint (string uriString, IWebProxy proxy)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public static ServicePoint FindServicePoint (Uri address, IWebProxy proxy)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+//\r
+// System.Net.WebException.cs\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System.Runtime.Serialization;\r
+\r
+namespace System.Net \r
+{\r
+ [Serializable]\r
+ public class WebException : InvalidOperationException, ISerializable\r
+ {\r
+ private WebResponse response;\r
+ private WebExceptionStatus status;\r
+ \r
+\r
+ // Constructors\r
+ \r
+ public WebException () : base ()\r
+ {\r
+ }\r
+ \r
+ public WebException (string message) : base (message)\r
+ {\r
+ }\r
+\r
+ protected WebException (SerializationInfo serializationInfo,\r
+ StreamingContext streamingContext)\r
+ : base (serializationInfo, streamingContext)\r
+ {\r
+ }\r
+\r
+ public WebException (string message, Exception innerException)\r
+ : base (message, innerException)\r
+ {\r
+ }\r
+\r
+ public WebException (string message, WebExceptionStatus status)\r
+ : base (message)\r
+ {\r
+ this.status = status;\r
+ }\r
+\r
+ public WebException(string message, \r
+ Exception innerException,\r
+ WebExceptionStatus status, \r
+ WebResponse response)\r
+ : base (message, innerException) \r
+ {\r
+ this.status = status;\r
+ this.response = response;\r
+ }\r
+ \r
+ // Properties\r
+ \r
+ public WebResponse Response {\r
+ get { return this.response; }\r
+ }\r
+ \r
+ public WebExceptionStatus Status {\r
+ get { return this.status; }\r
+ }\r
+ \r
+ // Methods\r
+ \r
+ void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
+ {\r
+ base.GetObjectData (info, context);\r
+ }\r
+ }\r
+}\r
+ \r
--- /dev/null
+//\r
+// System.Net.WebHeaderCollection\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System;\r
+using System.Collections.Specialized;\r
+using System.Runtime.InteropServices;\r
+using System.Runtime.Serialization;\r
+\r
+namespace System.Net \r
+{\r
+ [Serializable]\r
+ [ComVisible(true)]\r
+ public class WebHeaderCollection : NameValueCollection, ISerializable\r
+ {\r
+ // Constructors\r
+ \r
+ public WebHeaderCollection ()\r
+ : base () \r
+ {\r
+ }\r
+ \r
+ [MonoTODO]\r
+ protected WebHeaderCollection (SerializationInfo serializationInfo, \r
+ StreamingContext streamingContext)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ \r
+ // Properties\r
+ \r
+ public virtual long ContentLength { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+\r
+ // Methods\r
+ \r
+ [MonoTODO]\r
+ public void Add (string header)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public override void Add (string name, string value)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ protected void AddWithoutValidate (string headerName, string headerValue)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public override string [] GetValues (string header)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public static bool IsRestricted (string headerName)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public override void OnDeserialization (object sender)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public override void Remove (string name)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public override void Set (string name, string value)\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public byte[] ToByteArray ()\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+\r
+ [MonoTODO]\r
+ public override string ToString ()\r
+ {\r
+ throw new NotImplementedException ();\r
+ }\r
+ \r
+ [MonoTODO]\r
+ void ISerializable.GetObjectData (SerializationInfo serializationInfo,\r
+ StreamingContext streamingContext)\r
+ {\r
+ throw new NotImplementedException ();\r
+ } \r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+//\r
+// System.Net.WebRequest\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System;\r
+using System.IO;\r
+using System.Runtime.Serialization;\r
+\r
+namespace System.Net \r
+{\r
+ [Serializable]\r
+ public abstract class WebRequest : MarshalByRefObject, ISerializable\r
+ {\r
+ // Constructors\r
+ \r
+ protected WebRequest () {} \r
+ \r
+ protected WebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ // Properties\r
+ \r
+ public virtual string ConnectionGroupName { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual long ContentLength { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual string ContentType { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual ICredentials Credentials { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual WebHeaderCollection Headers { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual string Method { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual bool PreAuthenticate { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual IWebProxy Proxy { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual Uri RequestUri { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual int Timeout { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ // Methods\r
+ \r
+ public virtual void Abort()\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ public virtual IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state) \r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ public virtual IAsyncResult BeginGetResponse (AsyncCallback callback, object state)\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+\r
+ public static WebRequest Create (string requestUriString) \r
+ {\r
+ if (requestUriString == null)\r
+ throw new ArgumentNullException ("requestUriString");\r
+ return Create (new Uri (requestUriString));\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public static WebRequest Create (Uri requestUri) \r
+ {\r
+ if (requestUri == null)\r
+ throw new ArgumentNullException ("requestUri");\r
+ throw new NotImplementedException ();\r
+ }\r
+ \r
+ [MonoTODO]\r
+ public static WebRequest CreateDefault (Uri requestUri)\r
+ {\r
+ if (requestUri == null)\r
+ throw new ArgumentNullException ("requestUri");\r
+ throw new NotImplementedException (); \r
+ }\r
+\r
+ public virtual Stream EndGetRequestStream (IAsyncResult asyncResult)\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ public virtual WebResponse EndGetResponse (IAsyncResult asyncResult)\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ public virtual Stream GetRequestStream()\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ public virtual WebResponse GetResponse()\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ void ISerializable.GetObjectData (SerializationInfo serializationInfo,\r
+ StreamingContext streamingContext)\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+\r
+ [MonoTODO] \r
+ public static bool RegisterPrefix (string prefix, IWebRequestCreate creator)\r
+ {\r
+ throw new NotImplementedException (); \r
+ }\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+//\r
+// System.Net.WebResponse\r
+//\r
+// Author:\r
+// Lawrence Pit (loz@cable.a2000.nl)\r
+//\r
+\r
+using System;\r
+using System.IO;\r
+using System.Runtime.Serialization;\r
+\r
+namespace System.Net \r
+{\r
+ [Serializable]\r
+ public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable\r
+ {\r
+ // Constructors\r
+ \r
+ protected WebResponse ()\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ protected WebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ // Properties\r
+ \r
+ public virtual long ContentLength { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual string ContentType { \r
+ get { throw new NotSupportedException (); }\r
+ set { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual WebHeaderCollection Headers { \r
+ get { throw new NotSupportedException (); }\r
+ }\r
+ \r
+ public virtual Uri ResponseUri { \r
+ get { throw new NotSupportedException (); }\r
+ } \r
+\r
+ // Methods\r
+ \r
+ public virtual void Close()\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ public virtual Stream GetResponseStream()\r
+ {\r
+ throw new NotSupportedException ();\r
+ }\r
+ \r
+ void IDisposable.Dispose()\r
+ {\r
+ Close ();\r
+ }\r
+ \r
+ void ISerializable.GetObjectData (SerializationInfo serializationInfo,\r
+ StreamingContext streamingContext)\r
+ {\r
+ throw new NotSupportedException ();\r
+ } \r
+ }\r
+}
\ No newline at end of file