hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1658393 - in /httpcomponents/httpasyncclient/trunk: httpasyncclient-cache/src/test/java/org/apache/http/impl/client/cache/ httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ httpasyncclient/src/main/java/org/apache/http/nio/conn/...
Date Mon, 09 Feb 2015 13:06:56 GMT
Author: olegk
Date: Mon Feb  9 13:06:56 2015
New Revision: 1658393

URL: http://svn.apache.org/r1658393
Log:
Resolved several outstanding TODOs after upgrade to HC 4.4

Modified:
    httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpAsyncCacheJiraNumber1147.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/PoolingNHttpClientConnectionManager.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/ssl/SSLIOSessionStrategy.java
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/AbstractAsyncTest.java

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpAsyncCacheJiraNumber1147.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpAsyncCacheJiraNumber1147.java?rev=1658393&r1=1658392&r2=1658393&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpAsyncCacheJiraNumber1147.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpAsyncCacheJiraNumber1147.java
Mon Feb  9 13:06:56 2015
@@ -27,8 +27,6 @@
 package org.apache.http.impl.client.cache;
 
 import org.apache.http.impl.execchain.ClientExecChain;
-import org.junit.Ignore;
-import org.junit.Test;
 
 public class TestHttpAsyncCacheJiraNumber1147 extends TestHttpCacheJiraNumber1147 {
 
@@ -40,8 +38,4 @@ public class TestHttpAsyncCacheJiraNumbe
         return new CachingHttpAsyncClientExecChain(backend, cache, config);
     }
 
-    @Override @Test @Ignore // TODO: re-enable the test after HttpClient 4.3.4 release
-    public void testIssue1147() throws Exception {
-        super.testIssue1147();
-    }
 }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/PoolingNHttpClientConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/PoolingNHttpClientConnectionManager.java?rev=1658393&r1=1658392&r2=1658393&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/PoolingNHttpClientConnectionManager.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/PoolingNHttpClientConnectionManager.java
Mon Feb  9 13:06:56 2015
@@ -64,7 +64,6 @@ import org.apache.http.nio.pool.SocketAd
 import org.apache.http.nio.reactor.ConnectingIOReactor;
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.reactor.ssl.SSLIOSession;
 import org.apache.http.pool.ConnPoolControl;
 import org.apache.http.pool.PoolStats;
 import org.apache.http.protocol.HttpContext;
@@ -344,10 +343,6 @@ public class PoolingNHttpClientConnectio
                 final IOSession ioSession = conn.getIOSession();
                 final IOSession currentSession = sf.upgrade(host, ioSession);
                 conn.bind(currentSession);
-                // TODO: to be removed (work-around for a bug in HttpCore 4.4b1)
-                if (currentSession instanceof SSLIOSession) {
-                    ioSession.setBufferStatus((SSLIOSession) currentSession);
-                }
             }
         }
     }

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/ssl/SSLIOSessionStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/ssl/SSLIOSessionStrategy.java?rev=1658393&r1=1658392&r2=1658393&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/ssl/SSLIOSessionStrategy.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/main/java/org/apache/http/nio/conn/ssl/SSLIOSessionStrategy.java
Mon Feb  9 13:06:56 2015
@@ -28,10 +28,8 @@
 package org.apache.http.nio.conn.ssl;
 
 import java.io.IOException;
-import java.net.URL;
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
-import java.util.Arrays;
 
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLContext;
@@ -41,22 +39,19 @@ import javax.net.ssl.SSLPeerUnverifiedEx
 import javax.net.ssl.SSLSession;
 import javax.security.auth.x500.X500Principal;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.http.HttpHost;
 import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
 import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier;
 import org.apache.http.conn.ssl.DefaultHostnameVerifier;
-import org.apache.http.conn.ssl.SSLContexts;
 import org.apache.http.conn.ssl.StrictHostnameVerifier;
 import org.apache.http.conn.ssl.X509HostnameVerifier;
-import org.apache.http.conn.util.PublicSuffixMatcher;
 import org.apache.http.conn.util.PublicSuffixMatcherLoader;
 import org.apache.http.nio.conn.SchemeIOSessionStrategy;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.ssl.SSLIOSession;
 import org.apache.http.nio.reactor.ssl.SSLMode;
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
+import org.apache.http.ssl.SSLContexts;
 import org.apache.http.util.Args;
 import org.apache.http.util.Asserts;
 import org.apache.http.util.TextUtils;
@@ -87,39 +82,11 @@ public class SSLIOSessionStrategy implem
         return s.split(" *, *");
     }
 
-    //TODO: remove after upgrade to HttpCore 4.4-beta2 or newer
-    private static volatile PublicSuffixMatcher DEFAULT_INSTANCE;
-
-    private static PublicSuffixMatcher getDefaultPublicSuffixMatcher() {
-        if (DEFAULT_INSTANCE == null) {
-            synchronized (PublicSuffixMatcherLoader.class) {
-                if (DEFAULT_INSTANCE == null){
-                    final URL url = PublicSuffixMatcherLoader.class.getResource(
-                            "/mozilla/public-suffix-list.txt");
-                    if (url != null) {
-                        try {
-                            DEFAULT_INSTANCE = PublicSuffixMatcherLoader.load(url);
-                        } catch (IOException ex) {
-                            // Should never happen
-                            final Log log = LogFactory.getLog(PublicSuffixMatcherLoader.class);
-                            if (log.isWarnEnabled()) {
-                                log.warn("Failure loading public suffix list from default
resource", ex);
-                            }
-                        }
-                    } else {
-                        DEFAULT_INSTANCE = new PublicSuffixMatcher(Arrays.asList("com"),
null);
-                    }
-                }
-            }
-        }
-        return DEFAULT_INSTANCE;
-    }
-
     /**
      * @since 4.1
      */
     public static HostnameVerifier getDefaultHostnameVerifier() {
-        return new DefaultHostnameVerifier(getDefaultPublicSuffixMatcher());
+        return new DefaultHostnameVerifier(PublicSuffixMatcherLoader.getDefault());
     }
 
     public static SSLIOSessionStrategy getDefaultStrategy() {

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/AbstractAsyncTest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/AbstractAsyncTest.java?rev=1658393&r1=1658392&r2=1658393&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/AbstractAsyncTest.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/localserver/AbstractAsyncTest.java
Mon Feb  9 13:06:56 2015
@@ -34,7 +34,7 @@ import org.apache.http.ExceptionLogger;
 import org.apache.http.HttpHost;
 import org.apache.http.config.Registry;
 import org.apache.http.config.RegistryBuilder;
-import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.DefaultHostnameVerifier;
 import org.apache.http.impl.nio.bootstrap.HttpServer;
 import org.apache.http.impl.nio.bootstrap.ServerBootstrap;
 import org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager;
@@ -98,9 +98,7 @@ public abstract class AbstractAsyncTest
         if (this.scheme.equals(ProtocolScheme.https)) {
             builder.register("https", new SSLIOSessionStrategy(
                     SSLTestContexts.createClientSSLContext(),
-                    // TODO: replace with the default hostname verifier
-                    // TODO: after upgrade to HttpCore 4.4-beta2 or newer
-                    NoopHostnameVerifier.INSTANCE));
+                    new DefaultHostnameVerifier()));
         }
         final Registry<SchemeIOSessionStrategy> registry =  builder.build();
         final DefaultConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(ioReactorConfig);



Mime
View raw message