Fix NET_2_1 builds.
authorAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Tue, 25 Oct 2011 15:29:28 +0000 (00:29 +0900)
committerAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Tue, 25 Oct 2011 15:29:28 +0000 (00:29 +0900)
mcs/class/System/System.Net/WebRequest.cs

index 3ad59e216eddc390665ccd8424abb8a914d9a8f0..71d3b675e23aa168b2e463366f9df5e742e918ee 100644 (file)
@@ -327,6 +327,7 @@ namespace System.Net
                [MonoTODO("Look in other places for proxy config info")]
                public static IWebProxy GetSystemWebProxy ()
                {
+#if !NET_2_1
                        if (IsWindows ()) {
                                int iProxyEnable = (int)Microsoft.Win32.Registry.GetValue ("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyEnable", 0);
 
@@ -359,6 +360,7 @@ namespace System.Net
                                        return new WebProxy (strHttpProxy, bBypassOnLocal, al.ToArray (typeof(string)) as string[]);
                                }
                        } else {
+#endif
                                string address = Environment.GetEnvironmentVariable ("http_proxy");
 
                                if (address == null)
@@ -403,7 +405,9 @@ namespace System.Net
                                        } catch (UriFormatException) {
                                        }
                                }
+#if !NET_2_1
                        }
+#endif
                        
                        if (cfGetDefaultProxy != null)
                                return (IWebProxy) cfGetDefaultProxy.Invoke (null, null);