dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] pnetlib/System/Net GlobalProxySelection.cs, 1.3, 1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/System/Net GlobalProxySelection.cs, 1.3, 1.4 HttpWebRequest.cs, 1.20, 1.21
Date: Sun, 23 Nov 2003 21:43:41 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/System/Net
In directory subversions:/tmp/cvs-serv26761/System/Net

Modified Files:
        GlobalProxySelection.cs HttpWebRequest.cs 
Log Message:


Add proxy configuration via the "PNET_PROXY" environment variable.


Index: GlobalProxySelection.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/Net/GlobalProxySelection.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GlobalProxySelection.cs     28 Aug 2003 03:12:20 -0000      1.3
--- GlobalProxySelection.cs     23 Nov 2003 21:43:38 -0000      1.4
***************
*** 46,50 ****
                                                        // TODO: read the proxy 
information from
                                                        // the configuration 
settings.
!                                                       select = new 
EmptyWebProxy();
                                                }
                                                return select;
--- 46,76 ----
                                                        // TODO: read the proxy 
information from
                                                        // the configuration 
settings.
!                                                       String proxy = 
Environment.GetEnvironmentVariable("PNET_PROXY");
!                                                       try
!                                                       {       
!                                                               if(proxy != 
null)
!                                                               {
!                                                                       Uri 
proxyUri = new Uri(proxy);
!                                                                       select 
= new WebProxy(proxyUri);
!                                                                       String 
userinfo=proxyUri.UserInfo;
!                                                                       
if(userinfo != null && userinfo != "" &&
!                                                                               
                        userinfo.IndexOf(":")!=-1)
!                                                                       {
!                                                                               
String [] auth=userinfo.Split(':');
!                                                                               
select.Credentials = 
!                                                                               
                new NetworkCredential(auth[0],auth[1]);
!                                                                       }
!                                                                       
!                                                               }
!                                                       }
!                                                       
catch(UriFormatException)
!                                                       {
!                                                               
//System.Diagnostics.Debug.WriteLine("Invalid proxy");
!                                                       }
! 
!                                                       if(select == null)
!                                                       {
!                                                               select = new 
EmptyWebProxy();
!                                                       }
                                                }
                                                return select;

Index: HttpWebRequest.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/Net/HttpWebRequest.cs,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** HttpWebRequest.cs   20 Nov 2003 00:11:08 -0000      1.20
--- HttpWebRequest.cs   23 Nov 2003 21:43:38 -0000      1.21
***************
*** 517,520 ****
--- 517,524 ----
                get
                {
+                       if(this.proxy==null)
+                       {
+                               this.proxy=GlobalProxySelection.Select;
+                       }
                        return this.proxy;
                } 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]