directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r354382 - in /directory/network/trunk/src/java/org/apache/mina: common/ common/support/ filter/ filter/codec/ filter/support/
Date Tue, 06 Dec 2005 09:11:14 GMT
Author: trustin
Date: Tue Dec  6 01:11:05 2005
New Revision: 354382

URL: http://svn.apache.org/viewcvs?rev=354382&view=rev
Log:
My previous fix on DIRMINA-138 (Deadlock in SSLFilter) caused a lot of problems.
I'm reverting back and applying a brand new fix.

Modified:
    directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java
    directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java
    directory/network/trunk/src/java/org/apache/mina/common/IoFuture.java
    directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java
    directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java
    directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java
    directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
    directory/network/trunk/src/java/org/apache/mina/filter/support/SSLHandler.java

Modified: directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/CloseFuture.java Tue Dec  6 01:11:05
2005
@@ -44,14 +44,6 @@
     }
     
     /**
-     * Creates a new instance which uses the specified object as a lock.
-     */
-    public CloseFuture( Object lock )
-    {
-        super( lock );
-    }
-    
-    /**
      * Returns <tt>true</tt> if the close request is finished and the session
is closed.
      */
     public boolean isClosed()

Modified: directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/ConnectFuture.java Tue Dec  6
01:11:05 2005
@@ -54,14 +54,6 @@
     }
     
     /**
-     * Creates a new instance which uses the specified object as a lock.
-     */
-    public ConnectFuture( Object lock )
-    {
-        super( lock );
-    }
-
-    /**
      * Returns {@link IoSession} which is the result of connect operation.
      * 
      * @return <tt>null</tt> if the connect operation is not finished yet

Modified: directory/network/trunk/src/java/org/apache/mina/common/IoFuture.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/IoFuture.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/IoFuture.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/IoFuture.java Tue Dec  6 01:11:05
2005
@@ -57,26 +57,6 @@
     }
     
     /**
-     * Creates a new instance which uses the specified object as a lock.
-     */
-    protected IoFuture( Object lock )
-    {
-        if( lock == null )
-        {
-            throw new NullPointerException( "lock" );
-        }
-        this.lock = lock;
-    }
-    
-    /**
-     * Returns the lock object this future acquires.
-     */
-    public Object getLock()
-    {
-        return lock;
-    }
-    
-    /**
      * Wait for the asynchronous operation to end.
      */
     public void join()

Modified: directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/WriteFuture.java Tue Dec  6 01:11:05
2005
@@ -71,14 +71,6 @@
     }
     
     /**
-     * Creates a new instance which uses the specified object as a lock.
-     */
-    public WriteFuture( Object lock )
-    {
-        super( lock );
-    }
-    
-    /**
      * Returns <tt>true</tt> if the write operation is finished successfully.
      */
     public boolean isWritten()

Modified: directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.java Tue
Dec  6 01:11:05 2005
@@ -45,7 +45,7 @@
     /** 
      * A future that will be set 'closed' when the connection is closed.
      */
-    private final CloseFuture closeFuture = new CloseFuture( this );
+    private final CloseFuture closeFuture = new CloseFuture();
     private boolean closing;
 
     // Configuration variables
@@ -126,7 +126,7 @@
         }
         else
         {
-            future = new WriteFuture( this );
+            future = new WriteFuture();
             write0( new WriteRequest( message, future ) );
         }
         return future;

Modified: directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/SSLFilter.java Tue Dec  6 01:11:05
2005
@@ -570,19 +570,25 @@
     
     public void filterClose( NextFilter nextFilter, IoSession session, CloseFuture closeFuture
) throws SSLException
     {
+        WriteFuture future = null;
         synchronized( session )
         {
             try
             {
                 if( isSSLStarted( session ) )
                 {
-                    initiateClosure( nextFilter, session ).join();
+                    future = initiateClosure( nextFilter, session );
                 }
             }
             finally
             {
                 nextFilter.filterClose( session, closeFuture );
             }
+        }
+        
+        if( future != null )
+        {
+            future.join();
         }
     }
     

Modified: directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
Tue Dec  6 01:11:05 2005
@@ -289,7 +289,7 @@
             }
             else
             {
-                future = new WriteFuture( session );
+                future = new WriteFuture();
                 nextFilter.filterWrite( session, new WriteRequest( buf, future ) );
             }
             return future;

Modified: directory/network/trunk/src/java/org/apache/mina/filter/support/SSLHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/support/SSLHandler.java?rev=354382&r1=354381&r2=354382&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/support/SSLHandler.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/support/SSLHandler.java Tue Dec
 6 01:11:05 2005
@@ -511,7 +511,7 @@
             }
             //debug("outNetBuffer (after copy): {0}", sslHandler.getOutNetBuffer());
             
-            writeFuture = new WriteFuture( session );
+            writeFuture = new WriteFuture();
             parent.filterWrite( nextFilter, session, new WriteRequest( writeBuffer, writeFuture
) );
 
             // loop while more writes required to complete handshake
@@ -535,7 +535,7 @@
                         SessionLog.debug( session, " write outNetBuffer2: " + getOutNetBuffer()
);
                     }
                     org.apache.mina.common.ByteBuffer writeBuffer2 = copy( getOutNetBuffer()
);
-                    writeFuture = new WriteFuture( session );
+                    writeFuture = new WriteFuture();
                     parent.filterWrite( nextFilter, session, new WriteRequest( writeBuffer2,
writeFuture ) );
                 }
             }



Mime
View raw message