directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r354376 - in /directory/network/trunk/src: java/org/apache/mina/common/support/ java/org/apache/mina/filter/codec/ java/org/apache/mina/filter/support/ test/org/apache/mina/common/ test/org/apache/mina/filter/ test/org/apache/mina/filter/co...
Date Tue, 06 Dec 2005 08:57:33 GMT
Author: trustin
Date: Tue Dec  6 00:57:23 2005
New Revision: 354376

URL: http://svn.apache.org/viewcvs?rev=354376&view=rev
Log:
Found a few deadlocks after resolving DIRMINA-138 - Deadlock in SSLFilter, and fixed them

Modified:
    directory/network/trunk/src/java/org/apache/mina/common/support/BaseIoSession.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
    directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java
    directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
    directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java

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=354376&r1=354375&r2=354376&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 00:57:23 2005
@@ -119,13 +119,14 @@
     
     public synchronized WriteFuture write( Object message )
     {
-        WriteFuture future = new WriteFuture();
+        WriteFuture future;
         if( isClosing() || !isConnected() )
         {
-            future.setWritten( false );
+            future = WriteFuture.newNotWrittenFuture();
         }
         else
         {
+            future = new WriteFuture( this );
             write0( new WriteRequest( message, future ) );
         }
         return future;

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=354376&r1=354375&r2=354376&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 00:57:23 2005
@@ -289,7 +289,7 @@
             }
             else
             {
-                future = new WriteFuture();
+                future = new WriteFuture( session );
                 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=354376&r1=354375&r2=354376&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 00:57:23 2005
@@ -511,7 +511,7 @@
             }
             //debug("outNetBuffer (after copy): {0}", sslHandler.getOutNetBuffer());
             
-            writeFuture = new WriteFuture();
+            writeFuture = new WriteFuture( session );
             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();
+                    writeFuture = new WriteFuture( session );
                     parent.filterWrite( nextFilter, session, new WriteRequest( writeBuffer2,
writeFuture ) );
                 }
             }

Modified: directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java?rev=354376&r1=354375&r2=354376&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/common/IoFilterChainTest.java Tue Dec
 6 00:57:23 2005
@@ -255,10 +255,6 @@
             return null;
         }
 
-        public WriteFuture write(Object message) {
-            return null;
-        }
-
         public TransportType getTransportType() {
             return TransportType.VM_PIPE;
         }

Modified: directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java?rev=354376&r1=354375&r2=354376&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
(original)
+++ directory/network/trunk/src/test/org/apache/mina/filter/ThreadPoolFilterRegressionTest.java
Tue Dec  6 00:57:23 2005
@@ -152,11 +152,6 @@
             return null;
         }
 
-        public WriteFuture write( Object message )
-        {
-            return null;
-        }
-
         public CloseFuture close()
         {
             return null;
@@ -261,11 +256,6 @@
         }
 
         public IoFilterChain getFilterChain()
-        {
-            return null;
-        }
-
-        public WriteFuture write( Object message )
         {
             return null;
         }

Modified: directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java?rev=354376&r1=354375&r2=354376&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java
(original)
+++ directory/network/trunk/src/test/org/apache/mina/filter/codec/CumulativeProtocolDecoderTest.java
Tue Dec  6 00:57:23 2005
@@ -32,7 +32,6 @@
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.IoSessionManager;
 import org.apache.mina.common.TransportType;
-import org.apache.mina.common.WriteFuture;
 import org.apache.mina.common.support.BaseIoSession;
 
 /**
@@ -195,10 +194,6 @@
         }
 
         public CloseFuture close() {
-            return null;
-        }
-
-        public WriteFuture write( Object message ) {
             return null;
         }
 



Mime
View raw message