directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r164539 - in /directory/network/trunk/src/java/org/apache/mina/io: filter/SSLFilter.java socket/SocketIoProcessor.java
Date Mon, 25 Apr 2005 05:39:30 GMT
Author: trustin
Date: Sun Apr 24 22:39:28 2005
New Revision: 164539

URL: http://svn.apache.org/viewcvs?rev=164539&view=rev
Log:
* Fixed: ByteBuffers not actually written is not returned buffer pool.
* Removed contributers section from SSLFilter

Modified:
    directory/network/trunk/src/java/org/apache/mina/io/filter/SSLFilter.java
    directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.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?rev=164539&r1=164538&r2=164539&view=diff
==============================================================================
--- 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 Sun Apr 24 22:39:28
2005
@@ -40,17 +40,8 @@
  * This filter uses an {@link SSLEngine} which was introduced in Java 5, so 
  * Java version 5 or above is mandatory to use this filter. And please note that
  * this filter only works for TCP/IP connections.
- * <p>
  * 
- * <h3>Contribution</h3>
- * <ul>
- *   <li>This filter is written and contributed by Jan Andersson at first.</li>
- *   <li>Vinod Panicker made this filter also work in client-side.<li>
- * </ul>
- * Thanks to all contributers!
- * 
- * @author Jan Andersson (janne@minq.se)
- * @author Trustin Lee (trustin@apache.org)
+ * @author The Apache Directory Project (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
 public class SSLFilter extends IoHandlerFilterAdapter

Modified: directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?rev=164539&r1=164538&r2=164539&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/socket/SocketIoProcessor.java Sun
Apr 24 22:39:28 2005
@@ -201,6 +201,8 @@
             }
             finally
             {
+                releaseWriteBuffers( session );
+
                 session.getFilters().sessionClosed( session );
                 session.notifyClose();
             }
@@ -385,7 +387,10 @@
                 break;
 
             if( !session.isConnected() )
+            {
+                releaseWriteBuffers( session );
                 continue;
+            }
 
             try
             {
@@ -394,6 +399,25 @@
             catch( IOException e )
             {
                 scheduleRemove( session );
+                session.getFilters().exceptionCaught( session, e );
+            }
+        }
+    }
+    
+    private void releaseWriteBuffers( SocketSession session )
+    {
+        Queue writeBufferQueue = session.getWriteBufferQueue();
+        session.getWriteMarkerQueue().clear();
+        ByteBuffer buf;
+        
+        while( ( buf = (ByteBuffer) writeBufferQueue.pop() ) != null )
+        {
+            try
+            {
+                buf.release();
+            }
+            catch( IllegalStateException e )
+            {
                 session.getFilters().exceptionCaught( session, e );
             }
         }



Mime
View raw message