mina-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r546162 - in /mina: branches/1.0/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java branches/1.1/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java trunk/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java
Date Mon, 11 Jun 2007 14:41:19 GMT
Author: trustin
Date: Mon Jun 11 07:41:18 2007
New Revision: 546162

URL: http://svn.apache.org/viewvc?view=rev&rev=546162
Log:
Fixed a bug that attempting to write a message during SSL handshake procedure causes the handshake
failure.



Modified:
    mina/branches/1.0/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java
    mina/branches/1.1/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java
    mina/trunk/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java

Modified: mina/branches/1.0/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java
URL: http://svn.apache.org/viewvc/mina/branches/1.0/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java?view=diff&rev=546162&r1=546161&r2=546162
==============================================================================
--- mina/branches/1.0/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java (original)
+++ mina/branches/1.0/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java Mon Jun
11 07:41:18 2007
@@ -471,6 +471,7 @@
 
     public void filterWrite( NextFilter nextFilter, IoSession session, WriteRequest writeRequest
) throws SSLException
     {
+        boolean needsFlush = true;
         SSLHandler handler = getSSLSessionHandler( session );
         synchronized( handler )
         {
@@ -541,11 +542,14 @@
                         }
                         handler.schedulePreHandshakeWriteRequest( nextFilter, writeRequest
);
                     }
+                    needsFlush = false;
                 }
             }
         }
         
-        handler.flushPostHandshakeEvents();
+        if (needsFlush) {
+            handler.flushPostHandshakeEvents();
+        }
     }
     
     public void filterClose( final NextFilter nextFilter, final IoSession session ) throws
SSLException

Modified: mina/branches/1.1/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java
URL: http://svn.apache.org/viewvc/mina/branches/1.1/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java?view=diff&rev=546162&r1=546161&r2=546162
==============================================================================
--- mina/branches/1.1/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java (original)
+++ mina/branches/1.1/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java Mon Jun
11 07:41:18 2007
@@ -471,6 +471,7 @@
 
     public void filterWrite( NextFilter nextFilter, IoSession session, WriteRequest writeRequest
) throws SSLException
     {
+        boolean needsFlush = true;
         SSLHandler handler = getSSLSessionHandler( session );
         synchronized( handler )
         {
@@ -541,11 +542,14 @@
                         }
                         handler.schedulePreHandshakeWriteRequest( nextFilter, writeRequest
);
                     }
+                    needsFlush = false;
                 }
             }
         }
         
-        handler.flushPostHandshakeEvents();
+        if (needsFlush) {
+            handler.flushPostHandshakeEvents();
+        }
     }
     
     public void filterClose( final NextFilter nextFilter, final IoSession session ) throws
SSLException

Modified: mina/trunk/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java
URL: http://svn.apache.org/viewvc/mina/trunk/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java?view=diff&rev=546162&r1=546161&r2=546162
==============================================================================
--- mina/trunk/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java (original)
+++ mina/trunk/filter-ssl/src/main/java/org/apache/mina/filter/SSLFilter.java Mon Jun 11 07:41:18
2007
@@ -494,6 +494,7 @@
     @Override
     public void filterWrite( NextFilter nextFilter, IoSession session, WriteRequest writeRequest
) throws SSLException
     {
+        boolean needsFlush = true;
         SSLHandler handler = getSSLSessionHandler( session );
         synchronized( handler )
         {
@@ -564,11 +565,14 @@
                         }
                         handler.schedulePreHandshakeWriteRequest( nextFilter, writeRequest
);
                     }
+                    needsFlush = false;
                 }
             }
         }
         
-        handler.flushPostHandshakeEvents();
+        if (needsFlush) {
+            handler.flushPostHandshakeEvents();
+        }
     }
     
     @Override



Mime
View raw message