Просмотр исходного кода

If #CONFIGURATION_DEP isn't defined, we still want to get a default proxy

Jeffrey Stedfast 14 лет назад
Родитель
Сommit
dbff4b9934
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      mcs/class/System/System.Net/WebRequest.cs

+ 6 - 3
mcs/class/System/System.Net/WebRequest.cs

@@ -247,10 +247,10 @@ namespace System.Net
 		[MonoTODO("Needs to respect Module, Proxy.AutoDetect, and Proxy.ScriptLocation config settings")]
 		static IWebProxy GetDefaultWebProxy ()
 		{
-			WebProxy p = null;
-			
 #if CONFIGURATION_DEP
 			DefaultProxySection sec = ConfigurationManager.GetSection ("system.net/defaultProxy") as DefaultProxySection;
+			WebProxy p;
+			
 			if (sec == null)
 				return GetSystemWebProxy ();
 			
@@ -266,8 +266,11 @@ namespace System.Net
 			
 			if (pe.BypassOnLocal != ProxyElement.BypassOnLocalValues.Unspecified)
 				p.BypassProxyOnLocal = (pe.BypassOnLocal == ProxyElement.BypassOnLocalValues.True);
-#endif
+			
 			return p;
+#else
+			return GetSystemWebProxy ();
+#endif
 		}
 #endif