directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r161035 - directory/network/trunk/src/java/org/apache/mina/io/filter/SSLFilter.java directory/network/trunk/src/java/org/apache/mina/io/filter/SSLHandler.java
Date Tue, 12 Apr 2005 08:36:04 GMT
Author: trustin
Date: Tue Apr 12 01:36:03 2005
New Revision: 161035

URL: http://svn.apache.org/viewcvs?view=rev&rev=161035
Log:
Applying Janne's fix for DIRMINA-15


Modified:
    directory/network/trunk/src/java/org/apache/mina/io/filter/SSLFilter.java
    directory/network/trunk/src/java/org/apache/mina/io/filter/SSLHandler.java

Modified: directory/network/trunk/src/java/org/apache/mina/io/filter/SSLFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/filter/SSLFilter.java?view=diff&r1=161034&r2=161035
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/filter/SSLFilter.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/filter/SSLFilter.java Tue Apr 12 01:36:03
2005
@@ -124,31 +124,34 @@
         }
         if( sslHandler != null )
         {
-            // Start SSL shutdown process
-            try
+            synchronized( sslHandler )
             {
-                // shut down
-                sslHandler.shutdown();
-
-                // there might be data to write out here?
-                writeNetBuffer( session, sslHandler );
-            }
-            catch( SSLException ssle )
-            {
-                nextFilter.exceptionCaught( session, ssle );
-            }
-            finally
-            {
-                // notify closed session
-                nextFilter.sessionClosed( session );
-
-                // release buffers
-                sslHandler.release();
-                removeSSLSessionHandler( session );
+               // Start SSL shutdown process
+               try
+               {
+                  // shut down
+                  sslHandler.shutdown();
+                  
+                  // there might be data to write out here?
+                  writeNetBuffer( session, sslHandler );
+               }
+               catch( SSLException ssle )
+               {
+                  nextFilter.exceptionCaught( session, ssle );
+               }
+               finally
+               {
+                  // notify closed session
+                  nextFilter.sessionClosed( session );
+                  
+                  // release buffers
+                  sslHandler.release();
+                  removeSSLSessionHandler( session );
+               }
             }
         }
     }
-
+   
     public void dataRead( NextFilter nextFilter, IoSession session,
                          ByteBuffer buf )
     {

Modified: directory/network/trunk/src/java/org/apache/mina/io/filter/SSLHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/filter/SSLHandler.java?view=diff&r1=161034&r2=161035
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/filter/SSLHandler.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/filter/SSLHandler.java Tue Apr 12
01:36:03 2005
@@ -159,7 +159,7 @@
         if ( buf.limit() > inNetBuffer.remaining() ) {
             // We have to expand inNetBuffer
             inNetBuffer = SSLByteBufferPool.expandBuffer( inNetBuffer,
-                    2 * (inNetBuffer.position() + buf.limit()) );
+                inNetBuffer.capacity() + ( buf.limit() * 2 ) );
             // We also expand app. buffer (twice the size of in net. buffer)
             appBuffer = SSLByteBufferPool.expandBuffer( appBuffer, inNetBuffer.capacity()
* 2);
             appBuffer.position( 0 );



Mime
View raw message