hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1167512 - in /httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http: impl/nio/conn/ nio/conn/
Date Sat, 10 Sep 2011 13:13:36 GMT
Author: olegk
Date: Sat Sep 10 13:13:36 2011
New Revision: 1167512

URL: http://svn.apache.org/viewvc?rev=1167512&view=rev
Log:
Tweaked OperatedClientConnection interface

Modified:
    httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientConnection.java
    httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedClientConnectionImpl.java
    httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/nio/conn/OperatedClientConnection.java

Modified: httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientConnection.java?rev=1167512&r1=1167511&r2=1167512&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientConnection.java
(original)
+++ httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/DefaultClientConnection.java
Sat Sep 10 13:13:36 2011
@@ -43,7 +43,6 @@ import org.apache.http.nio.conn.Operated
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.SessionInputBuffer;
 import org.apache.http.nio.reactor.SessionOutputBuffer;
-import org.apache.http.nio.reactor.ssl.SSLIOSession;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.params.HttpParams;
 
@@ -55,7 +54,6 @@ public class DefaultClientConnection
     private final Log log;
 
     private String id;
-    private SSLIOSession ssliosession;
 
     public DefaultClientConnection(
             final String id,
@@ -69,11 +67,6 @@ public class DefaultClientConnection
         if (this.log.isDebugEnabled() || this.wirelog.isDebugEnabled()) {
             this.session = new LoggingIOSession(iosession, this.id, this.log, this.wirelog);
         }
-        if (iosession instanceof SSLIOSession) {
-            this.ssliosession = (SSLIOSession) iosession;
-        } else {
-            this.ssliosession = null;
-        }
     }
 
     public void upgrade(final IOSession iosession) {
@@ -85,15 +78,10 @@ public class DefaultClientConnection
             this.session = iosession;
         }
         this.session.setBufferStatus(this);
-        if (iosession instanceof SSLIOSession) {
-            this.ssliosession = (SSLIOSession) iosession;
-        } else {
-            this.ssliosession = null;
-        }
     }
 
-    public SSLIOSession getSSLIOSession() {
-        return this.ssliosession;
+    public IOSession getIOSession() {
+        return this.session;
     }
 
     @Override

Modified: httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedClientConnectionImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedClientConnectionImpl.java?rev=1167512&r1=1167511&r2=1167512&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedClientConnectionImpl.java
(original)
+++ httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/impl/nio/conn/ManagedClientConnectionImpl.java
Sat Sep 10 13:13:36 2011
@@ -238,7 +238,7 @@ class ManagedClientConnectionImpl implem
 
     public boolean isSecure() {
         OperatedClientConnection conn = ensureConnection();
-        return conn.getSSLIOSession() != null;
+        return conn.getIOSession() instanceof SSLIOSession;
     }
 
     public HttpRoute getRoute() {
@@ -248,8 +248,12 @@ class ManagedClientConnectionImpl implem
 
     public SSLSession getSSLSession() {
         OperatedClientConnection conn = ensureConnection();
-        SSLIOSession iosession = conn.getSSLIOSession();
-        return iosession != null ? iosession.getSSLSession() : null;
+        IOSession iosession = conn.getIOSession();
+        if (iosession instanceof SSLIOSession) {
+            return ((SSLIOSession) iosession).getSSLSession();
+        } else {
+            return null;
+        }
     }
 
     public Object getState() {
@@ -320,7 +324,7 @@ class ManagedClientConnectionImpl implem
         iosession.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
 
         if (proxy == null) {
-            tracker.connectTarget(conn.getSSLIOSession() != null);
+            tracker.connectTarget(conn.getIOSession() instanceof SSLIOSession);
         } else {
             tracker.connectProxy(proxy, false);
         }

Modified: httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/nio/conn/OperatedClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/nio/conn/OperatedClientConnection.java?rev=1167512&r1=1167511&r2=1167512&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/nio/conn/OperatedClientConnection.java
(original)
+++ httpcomponents/httpasyncclient/branches/protocol-handler-refactoring/httpasyncclient/src/main/java/org/apache/http/nio/conn/OperatedClientConnection.java
Sat Sep 10 13:13:36 2011
@@ -30,13 +30,12 @@ import org.apache.http.HttpInetConnectio
 import org.apache.http.nio.NHttpClientConnection;
 import org.apache.http.nio.NHttpClientIOTarget;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.reactor.ssl.SSLIOSession;
 
 public interface OperatedClientConnection
     extends NHttpClientConnection, HttpInetConnection, NHttpClientIOTarget {
 
     void upgrade(IOSession iosession);
 
-    SSLIOSession getSSLIOSession();
+    IOSession getIOSession();
 
 }



Mime
View raw message