harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r470485 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ test/java/org/apache/harmony/tests/internal/net/www/protocol/http/
Date Thu, 02 Nov 2006 19:27:38 GMT
Author: pyang
Date: Thu Nov  2 11:27:37 2006
New Revision: 470485

URL: http://svn.apache.org/viewvc?view=rev&rev=470485
Log:
usingProxy() should return false when Proxy.NO_PROXY

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java?view=diff&rev=470485&r1=470484&r2=470485
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
Thu Nov  2 11:27:37 2006
@@ -1263,7 +1263,7 @@
     private InetAddress getHostAddress() throws IOException {
         if (hostAddress == null) {
             // the value was not set yet
-            if (proxy != null) {
+            if (proxy != null && proxy.type() != Proxy.Type.DIRECT) {
                 hostAddress = ((InetSocketAddress) proxy.address()).getAddress();
             } else {
                 hostAddress = InetAddress.getByName(url.getHost());
@@ -1294,7 +1294,7 @@
 
     @Override
     public boolean usingProxy() {
-        return (proxy != null);
+        return (proxy != null && proxy.type() != Proxy.Type.DIRECT);
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java?view=diff&rev=470485&r1=470484&r2=470485
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
Thu Nov  2 11:27:37 2006
@@ -210,6 +210,9 @@
 
         assertTrue("Connection does not use proxy", connection.usingProxy());
         assertTrue("Proxy server was not used", proxy.accepted);
+        
+        HttpURLConnection huc = (HttpURLConnection)url.openConnection(Proxy.NO_PROXY);
+        assertFalse(huc.usingProxy());
     }
 
     /**



Mime
View raw message