harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r992322 - in /harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse: SSLSessionImpl.java SSLSocketImpl.java
Date Fri, 03 Sep 2010 15:10:12 GMT
Author: odeakin
Date: Fri Sep  3 15:10:11 2010
New Revision: 992322

URL: http://svn.apache.org/viewvc?rev=992322&view=rev
Log:
Implement getPeerHost() and getPeerPort() on SSLSession.

Modified:
    harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
    harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java

Modified: harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java?rev=992322&r1=992321&r2=992322&view=diff
==============================================================================
--- harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
(original)
+++ harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
Fri Sep  3 15:10:11 2010
@@ -247,7 +247,7 @@ public class SSLSessionImpl implements S
     private SSLSessionImpl() {
     }
 
-    public SSLSessionImpl(SSLParameters parms, long SSL) {
+    public SSLSessionImpl(SSLSocketImpl socket, SSLParameters parms, long SSL) {
         sslParameters = parms;
         this.SSL = SSL;
 
@@ -275,6 +275,11 @@ public class SSLSessionImpl implements S
             id[29] = (byte) ((time & 0x00FF0000) >>> 16);
             id[30] = (byte) ((time & 0x0000FF00) >>> 8);
             id[31] = (byte) ((time & 0x000000FF));
+
+            if (socket != null) {
+                peerPort = socket.getPort();
+                peerHost = socket.getInetAddress().getHostName();
+            }
         }
 
         lastAccessedTime = creationTime;
@@ -360,12 +365,10 @@ public class SSLSessionImpl implements S
         return peerCertificates;
     }
 
-    // TODO: implement
     public String getPeerHost() {
         return peerHost;
     }
 
-    // TODO: implement
     public int getPeerPort() {
         return peerPort;
     }

Modified: harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java?rev=992322&r1=992321&r2=992322&view=diff
==============================================================================
--- harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
(original)
+++ harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
Fri Sep  3 15:10:11 2010
@@ -502,7 +502,7 @@ public class SSLSocketImpl extends SSLSo
             logger.println("SSLSocketImpl: Handshake complete, notifying listeners");
         }
 
-        session = new SSLSessionImpl(sslParameters, SSL);
+        session = new SSLSessionImpl(this, sslParameters, SSL);
         // Notify handshake completion listeners
         if (listeners != null) {
             HandshakeCompletedEvent event =



Mime
View raw message