Browse Source

2010-02-05 Atsushi Enomoto <[email protected]>

	*  HttpRequestChannel.cs, HttpTransportBindingElement.cs :
	  enable authentication schemes on monotouch.

	* Dummy_2_1.cs : remove AuthenticationSchemes. It blocks MT support.


svn path=/trunk/mcs/; revision=150909
Atsushi Eno 16 years ago
parent
commit
af5c0da74d

+ 4 - 0
mcs/class/System.ServiceModel/ChangeLog

@@ -1,3 +1,7 @@
+2010-02-05  Astushi Enomoto  <[email protected]>
+
+	* Dummy_2_1.cs : remove AuthenticationSchemes. It blocks MT support.
+
 2010-02-04  Astushi Enomoto  <[email protected]>
 
 	* Dummy.cs, net_2_1_raw_System.ServiceModel.dll.sources : add some

+ 0 - 4
mcs/class/System.ServiceModel/Dummy_2_1.cs

@@ -31,10 +31,6 @@ namespace System.ServiceModel.Security
 {
 	class Dummy {}
 }
-namespace System.Net
-{
-	public enum AuthenticationSchemes {Anonymous}
-}
 namespace System.Net.Security
 {
 	public enum ProtectionLevel {None}

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog

@@ -1,3 +1,8 @@
+2010-02-05  Atsushi Enomoto  <[email protected]>
+
+	*  HttpRequestChannel.cs, HttpTransportBindingElement.cs :
+	  enable authentication schemes on monotouch.
+
 2010-02-04  Atsushi Enomoto  <[email protected]>
 
 	* SvcHttpHandler.cs : a wait handle could be used for more than one

+ 1 - 1
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestChannel.cs

@@ -93,7 +93,7 @@ namespace System.ServiceModel.Channels
 				((HttpWebRequest) web_request).CookieContainer = cmgr.CookieContainer;
 #endif
 
-#if !NET_2_1 // until we support NetworkCredential like SL4 will do.
+#if !NET_2_1 || MONOTOUCH // until we support NetworkCredential like SL4 will do.
 			// client authentication (while SL3 has NetworkCredential class, it is not implemented yet. So, it is non-SL only.)
 			var httpbe = (HttpTransportBindingElement) source.Transport;
 			string authType = null;

+ 22 - 16
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpTransportBindingElement.cs

@@ -42,15 +42,17 @@ namespace System.ServiceModel.Channels
 			unsafe_ntlm_auth;
 		bool use_default_proxy = true, keep_alive_enabled = true;
 		int max_buffer_size = 0x10000;
-		AuthenticationSchemes auth_scheme =
-			AuthenticationSchemes.Anonymous;
-		AuthenticationSchemes proxy_auth_scheme =
-			AuthenticationSchemes.Anonymous;
 		HostNameComparisonMode host_cmp_mode;
 		Uri proxy_address;
 		string realm = String.Empty;
 		TransferMode transfer_mode;
 		IDefaultCommunicationTimeouts timeouts;
+#if !NET_2_1
+		AuthenticationSchemes auth_scheme =
+			AuthenticationSchemes.Anonymous;
+		AuthenticationSchemes proxy_auth_scheme =
+			AuthenticationSchemes.Anonymous;
+#endif
 		// If you add fields, do not forget them in copy constructor.
 
 		public HttpTransportBindingElement ()
@@ -67,26 +69,35 @@ namespace System.ServiceModel.Channels
 			use_default_proxy = other.use_default_proxy;
 			keep_alive_enabled = other.keep_alive_enabled;
 			max_buffer_size = other.max_buffer_size;
-			auth_scheme = other.auth_scheme;
-			proxy_auth_scheme = other.proxy_auth_scheme;
 			host_cmp_mode = other.host_cmp_mode;
 			proxy_address = other.proxy_address;
 			realm = other.realm;
 			transfer_mode = other.transfer_mode;
 			// FIXME: it does not look safe
 			timeouts = other.timeouts;
+#if !NET_2_1
+			auth_scheme = other.auth_scheme;
+			proxy_auth_scheme = other.proxy_auth_scheme;
+#endif
 		}
 
-		public bool AllowCookies {
-			get { return allow_cookies; }
-			set { allow_cookies = value; }
-		}
-
+#if !NET_2_1
 		public AuthenticationSchemes AuthenticationScheme {
 			get { return auth_scheme; }
 			set { auth_scheme = value; }
 		}
 
+		public AuthenticationSchemes ProxyAuthenticationScheme {
+			get { return proxy_auth_scheme; }
+			set { proxy_auth_scheme = value; }
+		}
+#endif
+
+		public bool AllowCookies {
+			get { return allow_cookies; }
+			set { allow_cookies = value; }
+		}
+
 		public bool BypassProxyOnLocal {
 			get { return bypass_proxy_on_local; }
 			set { bypass_proxy_on_local = value; }
@@ -112,11 +123,6 @@ namespace System.ServiceModel.Channels
 			set { proxy_address = value; }
 		}
 
-		public AuthenticationSchemes ProxyAuthenticationScheme {
-			get { return proxy_auth_scheme; }
-			set { proxy_auth_scheme = value; }
-		}
-
 		public string Realm {
 			get { return realm; }
 			set { realm = value; }